ImportError: cannot import name ‘create_repo‘

报错:

Traceback (most recent call last):

File "rewrite_storage.py", line 8, in

from test_film import rewrite_main

File "/home/dev/rewritestorage/test.py", line 11, in

from utils.tokenizer import T5PegasusTokenizer

File "/home/dev/rewritestorage/utils/tokenizer.py", line 2, in

from transformers import BertTokenizer

File "/home/dev/rewritestorage/transformers/__init__.py", line 43, in

from . import dependency_versions_check

File "/home/dev/rewritestorage/transformers/dependency_versions_check.py", line 36, in

from .file_utils import is_tokenizers_available

File "/home/dev/rewritestorage/transformers/file_utils.py", line 52, in

from huggingface_hub import HfFolder, Repository, create_repo, list_repo_files, whoami

ImportError: cannot import name 'create_repo'

解决方法:

修改 /home/dev/rewritestorage/transformers/file_utils.py 文件中line 52,将create_repo, list_repo_files, whoami改为 HfApi;

from huggingface_hub import HfFolder, Repository, HfApi

你可能感兴趣的:(环境问题报错,transformer,深度学习)