From 2622e013ebc1ec5959ace9693a1ca51b929b42cc Mon Sep 17 00:00:00 2001 From: gilfordting <114829710+gilfordting@users.noreply.github.com> Date: Fri, 14 Aug 2026 03:17:42 -0400 Subject: [PATCH] [Fix] has_hf_quant_config crashes on local dirs without the config (#34774) Co-authored-by: harmya Co-authored-by: Claude Fable 5 --- python/sglang/srt/utils/common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/sglang/srt/utils/common.py b/python/sglang/srt/utils/common.py index b2a023c03..811b5023e 100644 --- a/python/sglang/srt/utils/common.py +++ b/python/sglang/srt/utils/common.py @@ -3304,9 +3304,10 @@ def has_hf_quant_config(model_path: str) -> bool: Returns: True if hf_quant_config.json exists, False otherwise. """ - # Check if the model_path is a local path - if os.path.exists(os.path.join(model_path, "hf_quant_config.json")): - return True + # Local paths are decided on the filesystem; the hub helpers below + # reject them as invalid repo ids. + if os.path.isdir(model_path): + return os.path.isfile(os.path.join(model_path, "hf_quant_config.json")) from huggingface_hub import try_to_load_from_cache