quantum00549 / SoftMaskedBert

《Spelling Error Correction with Soft-Masked BERT》论文复现
32 stars 3 forks source link

想问一下这个报错怎么解决 #2

Open Oldsport-996 opened 2 years ago

Oldsport-996 commented 2 years ago

404 Client Error: Not Found for url: https://huggingface.co//model/chinese-bert-wwm-ext/resolve/main/config.json Traceback (most recent call last): File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\configuration_utils.py", line 512, in get_config_dict resolved_config_file = cached_path( File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\file_utils.py", line 1370, in cached_path output_path = get_from_cache( File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\file_utils.py", line 1541, in get_from_cache r.raise_for_status() File "H:\Anaconda\envs\softmasked\lib\site-packages\requests\models.py", line 960, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co//model/chinese-bert-wwm-ext/resolve/main/config.json

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "F:/0:学习资料/0:研究生/0:纠正错误/SoftMaskedBert-main/model/train.py", line 252, in handler = engines(config) File "F:/0:学习资料/0:研究生/0:纠正错误/SoftMaskedBert-main/model/train.py", line 22, in init super(engines, self).init(config) File "F:\0:学习资料\0:研究生\0:纠正错误\SoftMaskedBert-main\model\model.py", line 29, in init self.bert = BertModel.from_pretrained(self.config.bert_path) File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\modeling_utils.py", line 1187, in from_pretrained config, model_kwargs = cls.config_class.from_pretrained( File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\configuration_utils.py", line 455, in from_pretrained config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs) File "H:\Anaconda\envs\softmasked\lib\site-packages\transformers\configuration_utils.py", line 532, in get_config_dict raise EnvironmentError(msg) OSError: Can't load config for '/model/chinese-bert-wwm-ext'. Make sure that:

我锁定不到要修改的位置

quantum00549 commented 2 years ago

似乎是预训练模型名字不对的问题(可能是改了), 去huggingface官网里找个自己需要的模型替换就行

lewispony commented 2 years ago

不知道解决了没有,同样遇到这个问题

quantum00549 commented 2 years ago

不知道解决了没有,同样遇到这个问题 最佳的解决思路就是, 去transformer官网找个确定有的模型, 然后挂VPN, 代码检测不到本地模型文件的时候会自动下载