Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

parser: don't check the file type of safetensors to prevent false negatives. (#12176)

frob4378ae4ffaaf
diff --git a/parser/parser.go b/parser/parser.go
index d40a79c29..e080f1bb7 100644
--- a/parser/parser.go
+++ b/parser/parser.go
@@ -246,7 +246,7 @@ func filesForModel(path string) ([]string, error) {
for _, match := range matches {
if ct, err := detectContentType(match); err != nil {
return nil, err
- } else if ct != contentType {
+ } else if len(contentType) > 0 && ct != contentType {
return nil, fmt.Errorf("invalid content type: expected %s for %s", ct, match)
}
}
@@ -255,7 +255,8 @@ func filesForModel(path string) ([]string, error) {
}
var files []string
- if st, _ := glob(filepath.Join(path, "*.safetensors"), "application/octet-stream"); len(st) > 0 {
+ // some safetensors files do not properly match "application/octet-stream", so skip checking their contentType
+ if st, _ := glob(filepath.Join(path, "*.safetensors"), ""); len(st) > 0 {
// safetensors files might be unresolved git lfs references; skip if they are
// covers model-x-of-y.safetensors, model.fp32-x-of-y.safetensors, model.safetensors
files = append(files, st...)