templates: add autotemplate for gemma3 (#9880)

This change allows the gemma3 template to be autodetected during `ollama
create`.
This commit is contained in:
Patrick Devine
2025-03-20 00:15:30 -07:00
committed by GitHub
parent b078dd157c
commit f8c3dbe5b5
7 changed files with 46 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ func detectChatTemplate(layers []*layerGGML) ([]*layerGGML, error) {
for _, layer := range layers {
if s := layer.GGML.KV().ChatTemplate(); s != "" {
if t, err := template.Named(s); err != nil {
slog.Debug("template detection", "error", err)
slog.Debug("template detection", "error", err, "template", s)
} else {
layer, err := NewLayer(t.Reader(), "application/vnd.ollama.image.template")
if err != nil {