[Bugfix] Treat unsharded model.safetensors as HF weights in Mistral-native format detection (#33671)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Alex Nails
2026-08-05 01:54:46 -07:00
committed by GitHub
co-authored by Claude Fable 5
parent 4a3d6ca88c
commit 6fa3f9df11
+6 -3
View File
@@ -7330,7 +7330,7 @@ class ServerArgs:
"""True iff the checkpoint requires load_format=mistral.
Looks for consolidated*.safetensors with no competing
model-*.safetensors; when both weight formats ship in the
model*.safetensors; when both weight formats ship in the
same checkpoint (e.g. Mistral-7B-Instruct-v0.3) the HF path is
preferred to avoid loading Mistral-named weights into an
HF-named architecture.
@@ -7363,7 +7363,7 @@ class ServerArgs:
)
),
has_hf_weights=bool(
glob.glob(os.path.join(self.model_path, "model-*.safetensors"))
glob.glob(os.path.join(self.model_path, "model*.safetensors"))
),
)
@@ -7378,7 +7378,10 @@ class ServerArgs:
for f in files
),
has_hf_weights=any(
f.startswith("model-") and f.endswith(".safetensors") for f in files
f.startswith("model")
and f.endswith(".safetensors")
and "/" not in f
for f in files
),
)
except Exception: