Open BMM666hh opened 4 weeks ago
Thank you for your reach out! Whether the version of "fastNLP" is 0.6.0? Or you can directly download the roberta model and load it locally.
Yes,the version of fastNLP is 0.6.0. Whether the fastNLP isn't work, because I can't open the website of it http://www.fastnlp.top/docs/fastNLP/master/index.html. If I download the roberta model, can I download from huggingface to get the pretrained embedding?
It is unable to directly use roberta from huggingface because it's two difffernt frameworks. And I remember it works well in my side when i use that version of fastNLP. Maybe you need to switch off the vpn or change another version of fastnlp that is compatible with your local env?
I've also tried running it on AutoDL, and it still gives the same http404 error, and opening the download URL that reported the error shows this screen.
Could it be an issue with the FastNLP URL closing? If this is the case, do you have another method to download the corresponding model pre-trained word embedding model?
在运行代码中,数据能够正常加载,但在使用RoBerta等模型时报错HTTP404错误,请问作者是否也遇到过此类问题?有没有什么解决办法呢?
报错情况:
2024-09-03 18:24:28 - urllib3.connectionpool - DEBUG: - Starting new HTTP connection (1): download.fastnlp.top:80 2024-09-03 18:24:28 - urllib3.connectionpool - DEBUG: - http://download.fastnlp.top:80 "GET /embedding/roberta-base.zip HTTP/11" 404 3650 Traceback (most recent call last): File "/home/uMIR_codes/Uni-MIS-master/train.py", line 43, in
model = MainModel(
File "/home/MIR_codes/Uni-MIS-master/models/main_model.py", line 31, in init
self.embedding = RobertaEmbedding(self.vocab,'en',include_cls_sep = True)
File "/home/.conda/envs/UniMisEnv/lib/python3.10/site-packages/fastNLP/embeddings/roberta_embedding.py", line 99, in init
self.model = _RobertaWordModel(model_dir_or_name=model_dir_or_name, vocab=vocab, layers=layers,
File "/home/.conda/envs/UniMisEnv/lib/python3.10/site-packages/fastNLP/embeddings/roberta_embedding.py", line 215, in init
self.tokenizer = RobertaTokenizer.from_pretrained(model_dir_or_name)
File "/home/.conda/envs/UniMisEnv/lib/python3.10/site-packages/fastNLP/modules/tokenizer/roberta_tokenizer.py", line 70, in from_pretrained
model_dir = _get_roberta_dir(model_dir_or_name)
File "/home/.conda/envs/UniMisEnv/lib/python3.10/site-packages/fastNLP/io/file_utils.py", line 538, in _get_roberta_dir
model_dir = cached_path(model_url, name='embedding')
File "/home/.conda/envs/UniMisEnv/lib/python3.10/site-packages/fastNLP/io/file_utils.py", line 187, in cached_path
return get_from_cache(url_or_filename, Path(data_cache))
File "/home/.conda/envs/UniMisEnv/lib/python3.10/site-packages/fastNLP/io/file_utils.py", line 459, in get_from_cache
raise HTTPError(f"Status code:{req.status_code}. Fail to download from {url}.")
requests.exceptions.HTTPError: Status code:404. Fail to download from http://download.fastnlp.top/embedding/roberta-base.zip.