[Bugfix] Fix modelscope usage (#52431)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
+1
-2
@@ -716,9 +716,8 @@ environment_variables: dict[str, Callable[[], Any]] = {
|
||||
"VLLM_RPC_BASE_PATH", tempfile.gettempdir()
|
||||
),
|
||||
# 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: (
|
||||
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
|
||||
# with the `fastokens` (https://github.com/crusoecloud/fastokens) shim.
|
||||
|
||||
@@ -48,15 +48,14 @@ def modelscope_list_repo_files(
|
||||
|
||||
api = HubApi()
|
||||
api.login(token)
|
||||
|
||||
# same as huggingface_hub.list_repo_files
|
||||
files = [
|
||||
return [
|
||||
file["Path"]
|
||||
for file in api.get_model_files(
|
||||
model_id=repo_id, revision=revision, recursive=True
|
||||
)
|
||||
if file["Type"] == "blob"
|
||||
]
|
||||
return files
|
||||
|
||||
|
||||
def _maybe_json_dict(path: str | PathLike) -> dict[str, str]:
|
||||
|
||||
Reference in New Issue
Block a user