From 6c9c8da64dd0b8dfb1648534c67e35741022a7e8 Mon Sep 17 00:00:00 2001 From: yrk111222 <2493404415@qq.com> Date: Wed, 10 Dec 2025 15:49:34 +0800 Subject: [PATCH] fix: add missing logic for SGLANG_USE_MODELSCOPE variable (#14794) --- python/sglang/srt/configs/model_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/configs/model_config.py b/python/sglang/srt/configs/model_config.py index 44406239d..bb08df8ef 100644 --- a/python/sglang/srt/configs/model_config.py +++ b/python/sglang/srt/configs/model_config.py @@ -537,7 +537,8 @@ class ModelConfig: is_local = os.path.exists(self.model_path) if not is_local: # Conditional import based on SGLANG_USE_MODELSCOPE environment variable - if envs.SGLANG_USE_MODELSCOPE is True: + if envs.SGLANG_USE_MODELSCOPE.get(): + from modelscope import HubApi, model_file_download hf_api = HubApi()