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()