Merge pull request #4265 from ollama/mxyng/fix-show-llava

routes: fix show llava models
This commit is contained in:
Michael Yang 2024-05-08 12:51:21 -07:00 committed by GitHub
commit 2687f02c96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -68,6 +68,20 @@ func (m *Model) String() string {
Args: m.ModelPath, Args: m.ModelPath,
}) })
for _, adapter := range m.AdapterPaths {
modelfile.Commands = append(modelfile.Commands, model.Command{
Name: "adapter",
Args: adapter,
})
}
for _, projector := range m.ProjectorPaths {
modelfile.Commands = append(modelfile.Commands, model.Command{
Name: "model",
Args: projector,
})
}
if m.Template != "" { if m.Template != "" {
modelfile.Commands = append(modelfile.Commands, model.Command{ modelfile.Commands = append(modelfile.Commands, model.Command{
Name: "template", Name: "template",
@ -82,20 +96,6 @@ func (m *Model) String() string {
}) })
} }
for _, adapter := range m.AdapterPaths {
modelfile.Commands = append(modelfile.Commands, model.Command{
Name: "adapter",
Args: adapter,
})
}
for _, projector := range m.ProjectorPaths {
modelfile.Commands = append(modelfile.Commands, model.Command{
Name: "projector",
Args: projector,
})
}
for k, v := range m.Options { for k, v := range m.Options {
switch v := v.(type) { switch v := v.(type) {
case []any: case []any: