(env) (base) PS D:\MiniGPT-4> python demo.py --cfg-path eval_configs/minigpt4_eval.yaml Initializing Chat Downloading (…)solve/main/vocab.txt: 100%|███████████████████████████████████████████████████| 232k/232k [00:00<00:00, 529kB/s] Loading VIT Loading VIT Done Loading Q-Former Traceback (most recent call last): File "D:\MiniGPT-4\env\lib\site-packages\transformers\utils\hub.py", line 409, in cached_file resolved_file = hf_hub_download( File "D:\MiniGPT-4\env\lib\site-packages\huggingface_hub\utils\_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "D:\MiniGPT-4\env\lib\site-packages\huggingface_hub\file_download.py", line 1259, in hf_hub_download raise LocalEntryNotFoundError( huggingface_hub.utils._errors.LocalEntryNotFoundError: Connection error, and we cannot find the requested files in the disk cache. Please try again or make sure your Internet connection is on. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\MiniGPT-4\demo.py", line 57, in <module> model = model_cls.from_config(model_config).to('cuda:0') File "D:\MiniGPT-4\minigpt4\models\mini_gpt4.py", line 241, in from_config model = cls( File "D:\MiniGPT-4\minigpt4\models\mini_gpt4.py", line 64, in __init__ self.Qformer, self.query_tokens = self.init_Qformer( File "D:\MiniGPT-4\minigpt4\models\blip2.py", line 47, in init_Qformer encoder_config = BertConfig.from_pretrained("bert-base-uncased") File "D:\MiniGPT-4\env\lib\site-packages\transformers\configuration_utils.py", line 546, in from_pretrained config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs) File "D:\MiniGPT-4\env\lib\site-packages\transformers\configuration_utils.py", line 573, in get_config_dict config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs) File "D:\MiniGPT-4\env\lib\site-packages\transformers\configuration_utils.py", line 628, in _get_config_dict resolved_config_file = cached_file( File "D:\MiniGPT-4\env\lib\site-packages\transformers\utils\hub.py", line 443, in cached_file raise EnvironmentError( OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like bert-base-uncased is not the path to a directory containing a file named config.json. Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
时间: 2023-09-01 18:13:55 浏览: 196
这个错误是由于网络连接问题导致无法下载所需的模型和文件。在初始化Chat时,脚本尝试从Hugging Face模型库中下载`VIT`和`Q-Former`模型,但由于无法连接到`https://huggingface.co`,导致下载失败。
请确保你的网络连接正常,并且能够访问`https://huggingface.co`网站。如果你使用的是代理,请确保代理设置正确。
如果你的网络连接正常,但仍然无法下载模型,你可以尝试使用离线模式运行脚本。在离线模式下,你需要手动下载所需的模型和文件,并将它们放置在正确的路径中。你可以参考Hugging Face文档中的离线模式部分了解更多信息。
希望这些提示能帮助你解决问题。如果你有其他疑问,请随时提问。
相关问题
(env) (base) PS D:\MiniGPT-4> python demo.py --cfg-path eval_configs/minigpt4_eval.yaml Initializing Chat Traceback (most recent call last): File "D:\MiniGPT-4\demo.py", line 57, in <module> model = model_cls.from_config(model_config).to('cuda:0') File "D:\MiniGPT-4\minigpt4\models\mini_gpt4.py", line 241, in from_config model = cls( File "D:\MiniGPT-4\minigpt4\models\mini_gpt4.py", line 44, in __init__ self.tokenizer = self.init_tokenizer() File "D:\MiniGPT-4\minigpt4\models\blip2.py", line 31, in init_tokenizer tokenizer = BertTokenizer.from_pretrained("bert-base-uncased") File "D:\MiniGPT-4\env\lib\site-packages\transformers\tokenization_utils_base.py", line 1795, in from_pretrained raise EnvironmentError( OSError: Can't load tokenizer for 'bert-base-uncased'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'bert-base-uncased' is the correct path to a directory containing all relevant files for a BertTokenizer tokenizer.
这个错误是由于无法加载'BertTokenizer'引起的。根据错误信息,它无法从本地或Hugging Face模型库中找到名为'bert-base-uncased'的tokenizer。
请确保你已经安装了相应的依赖项,并且可以从Hugging Face模型库中下载预训练的tokenizer。你可以使用以下命令安装必要的依赖项:
```
pip install transformers
```
如果你已经安装了`transformers`库但仍然遇到问题,可能是因为网络连接问题导致无法下载预训练模型。你可以尝试使用代理或手动下载所需的预训练模型。
另外,确保`bert-base-uncased`是正确的模型名称。你可以查看Hugging Face模型库以获取可用的模型名称和路径。
希望这些提示能帮助你解决问题。如果你有其他疑问,请随时提问。
阅读全文