mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 10:35:01 +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
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue