[Bugfix] Modify modelscope api usage in transformer_utils (#13807)
This commit is contained in:
parent
aab392774b
commit
2d87d7d1ac
@ -29,9 +29,8 @@ def modelscope_list_repo_files(
|
|||||||
) -> List[str]:
|
) -> List[str]:
|
||||||
"""List files in a modelscope repo."""
|
"""List files in a modelscope repo."""
|
||||||
from modelscope.hub.api import HubApi
|
from modelscope.hub.api import HubApi
|
||||||
from modelscope.utils.hf_util import _try_login
|
|
||||||
_try_login(token)
|
|
||||||
api = HubApi()
|
api = HubApi()
|
||||||
|
api.login(token)
|
||||||
# same as huggingface_hub.list_repo_files
|
# same as huggingface_hub.list_repo_files
|
||||||
files = [
|
files = [
|
||||||
file['Path'] for file in api.get_model_files(
|
file['Path'] for file in api.get_model_files(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user