mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-01 23:10:49 +00:00
feat(templates): add sprig to multimodal templates (#3868)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
d5da8c3509
commit
e1db6dce82
@ -3,11 +3,13 @@ package templates
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
|
"github.com/Masterminds/sprig/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TemplateMultiModal(templateString string, templateID int, text string) (string, error) {
|
func TemplateMultiModal(templateString string, templateID int, text string) (string, error) {
|
||||||
// compile the template
|
// compile the template
|
||||||
tmpl, err := template.New("template").Parse(templateString)
|
tmpl, err := template.New("template").Funcs(sprig.FuncMap()).Parse(templateString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user