[Bugfix] Fix modelscope usage (#52431)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2026-08-15 02:40:24 -07:00
committed by GitHub
parent 42156466db
commit 5cecfc0137
2 changed files with 3 additions and 5 deletions
+1 -2
View File
@@ -716,9 +716,8 @@ environment_variables: dict[str, Callable[[], Any]] = {
"VLLM_RPC_BASE_PATH", tempfile.gettempdir() "VLLM_RPC_BASE_PATH", tempfile.gettempdir()
), ),
# If true, will load models from ModelScope instead of Hugging Face Hub. # If true, will load models from ModelScope instead of Hugging Face Hub.
# note that the value is true or false, not numbers
"VLLM_USE_MODELSCOPE": lambda: ( "VLLM_USE_MODELSCOPE": lambda: (
os.environ.get("VLLM_USE_MODELSCOPE", "False").lower() == "true" os.environ.get("VLLM_USE_MODELSCOPE", "False").strip().lower() in ("1", "true")
), ),
# If true, replace the Rust BPE backend that powers HF fast tokenizers # If true, replace the Rust BPE backend that powers HF fast tokenizers
# with the `fastokens` (https://github.com/crusoecloud/fastokens) shim. # with the `fastokens` (https://github.com/crusoecloud/fastokens) shim.
+2 -3
View File
@@ -48,15 +48,14 @@ def modelscope_list_repo_files(
api = HubApi() api = HubApi()
api.login(token) api.login(token)
# same as huggingface_hub.list_repo_files # same as huggingface_hub.list_repo_files
files = [ return [
file["Path"] file["Path"]
for file in api.get_model_files( for file in api.get_model_files(
model_id=repo_id, revision=revision, recursive=True model_id=repo_id, revision=revision, recursive=True
) )
if file["Type"] == "blob"
] ]
return files
def _maybe_json_dict(path: str | PathLike) -> dict[str, str]: def _maybe_json_dict(path: str | PathLike) -> dict[str, str]: