Small fixup to template loading

add/first-example
mudler 2 years ago
parent b710147b95
commit 4a932483e1
  1. 3
      model_loader.go

@ -62,6 +62,7 @@ func (ml *ModelLoader) LoadModel(modelName string, opts ...llama.ModelOption) (*
if _, err := os.Stat(modelBin); os.IsNotExist(err) { if _, err := os.Stat(modelBin); os.IsNotExist(err) {
return nil, err return nil, err
} else { } else {
modelName = fmt.Sprintf("%s.bin", modelName)
modelFile = modelBin modelFile = modelBin
} }
} }
@ -87,7 +88,7 @@ func (ml *ModelLoader) LoadModel(modelName string, opts ...llama.ModelOption) (*
if err != nil { if err != nil {
return nil, err return nil, err
} }
ml.promptsTemplates[modelFile] = tmpl ml.promptsTemplates[modelName] = tmpl
} }
ml.models[modelFile] = model ml.models[modelFile] = model

Loading…
Cancel
Save