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: