[Bugfix] Modify modelscope api usage in transformer_utils (#13807)

This commit is contained in:
Shanshan Shen 2025-02-25 16:36:07 +08:00 committed by GitHub
parent aab392774b
commit 2d87d7d1ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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