From 6fa3f9df11c8bdbc0e3b4ddc87a3d873343aca72 Mon Sep 17 00:00:00 2001 From: Alex Nails Date: Wed, 5 Aug 2026 01:54:46 -0700 Subject: [PATCH] [Bugfix] Treat unsharded model.safetensors as HF weights in Mistral-native format detection (#33671) Co-authored-by: Claude Fable 5 --- python/sglang/srt/server_args.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index 278d7e2a1..0094b705a 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -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: