Commit d2454603 authored by Michael Yang's avatar Michael Yang
Browse files

only quantize language models

parent 4d0d0fa3
...@@ -377,7 +377,10 @@ func CreateModel(ctx context.Context, name, modelFileDir, quantization string, m ...@@ -377,7 +377,10 @@ func CreateModel(ctx context.Context, name, modelFileDir, quantization string, m
} }
for _, baseLayer := range baseLayers { 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) ftype, err := llm.ParseFileType(quantization)
if err != nil { if err != nil {
return err return err
...@@ -582,7 +585,6 @@ func CreateModel(ctx context.Context, name, modelFileDir, quantization string, m ...@@ -582,7 +585,6 @@ func CreateModel(ctx context.Context, name, modelFileDir, quantization string, m
return nil return nil
} }
func CopyModel(src, dst model.Name) error { func CopyModel(src, dst model.Name) error {
if !dst.IsFullyQualified() { if !dst.IsFullyQualified() {
return model.Unqualified(dst) return model.Unqualified(dst)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment