From 402904333ae5f489671eedd8e468da41b974fa62 Mon Sep 17 00:00:00 2001 From: "yuze.zyz" Date: Fri, 27 Dec 2024 00:04:59 +0800 Subject: [PATCH] fix --- modelscope/utils/hf_util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modelscope/utils/hf_util.py b/modelscope/utils/hf_util.py index cc63f214..788619ec 100644 --- a/modelscope/utils/hf_util.py +++ b/modelscope/utils/hf_util.py @@ -313,8 +313,8 @@ def patch_hub(): huggingface_hub.whoami = hf_api.whoami huggingface_hub.hf_api.whoami = hf_api.whoami - from huggingface_hub.repocard import RepoCard - RepoCard.validate = lambda *args, **kwargs: None + from huggingface_hub import repocard + repocard.RepoCard.validate = lambda *args, **kwargs: None def create_repo(repo_id: str, *, @@ -386,6 +386,7 @@ def patch_hub(): hf_api.upload_file = MethodType(upload_file, api) huggingface_hub.upload_file = hf_api.upload_file huggingface_hub.hf_api.upload_file = hf_api.upload_file + repocard.upload_file = hf_api.upload_file from transformers.utils import hub hub.create_repo = create_repo