From 3244a25c7988538b19c52642a6a86a24080e7ce3 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Thu, 25 Apr 2024 09:01:20 -0700 Subject: [PATCH] only quantize language models --- server/images.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/images.go b/server/images.go index 3ba307823..5519463e8 100644 --- a/server/images.go +++ b/server/images.go @@ -349,7 +349,10 @@ func CreateModel(ctx context.Context, name, modelFileDir, quantization string, c } for _, baseLayer := range baseLayers { - if quantization != "" && baseLayer.GGML != nil && baseLayer.GGML.Name() == "gguf" { + if quantization != "" && + baseLayer.MediaType == "application/vnd.ollama.image.model" && + baseLayer.GGML != nil && + baseLayer.GGML.Name() == "gguf" { ftype, err := llm.ParseFileType(quantization) if err != nil { return err @@ -555,7 +558,6 @@ func CreateModel(ctx context.Context, name, modelFileDir, quantization string, c return nil } - func CopyModel(src, dst model.Name) error { if !dst.IsFullyQualified() { return model.Unqualified(dst)