Traceback (most recent call last): File "/cyb/LAVIS/train.py", line 108, in <module> main() File "/cyb/LAVIS/train.py", line 97, in main model = task.build_model(cfg) File "/cyb/LAVIS/lavis/tasks/base_task.py", line 33, in build_model return model_cls.from_config(model_config) File "/cyb/LAVIS/lavis/models/blip2_models/blip2_opt.py", line 412, in from_config model = cls( File "/cyb/LAVIS/lavis/models/blip2_models/blip2_opt.py", line 85, in __init__ self.opt_tokenizer = AutoTokenizer.from_pretrained(opt_model, use_fast=False) File "/root/anaconda3/envs/ab/lib/python3.9/site-packages/transformers/models/auto/tokenization_auto.py", line 667, in from_pretrained config = AutoConfig.from_pretrained( File "/root/anaconda3/envs/ab/lib/python3.9/site-packages/transformers/models/auto/configuration_auto.py", line 983, in from_pretrained config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs) File "/root/anaconda3/envs/ab/lib/python3.9/site-packages/transformers/configuration_utils.py", line 617, in get_config_dict config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs) File "/root/anaconda3/envs/ab/lib/python3.9/site-packages/transformers/configuration_utils.py", line 672, in _get_config_dict resolved_config_file = cached_file( File "/root/anaconda3/envs/ab/lib/python3.9/site-packages/transformers/utils/hub.py", line 452, 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 facebook/opt-2.7b isnot the path to a directory containing a file named config.json.
尝试从Hugging Face Hub下载facebook/opt-2.7b模型失败了,具体代码位于blip2_opt.py文件的初始化方法中,调用AutoTokenizer.from_pretrained(opt_model, use_fast=False)时出现的。