Skip to content

无法加载模型 #58

@BMM666hh

Description

@BMM666hh

加载预训练好的词向量模型总是报错HTTP404,请问是网址停用了吗?如果是停用了还有什么别的下载方式吗?

报错信息具体如下:
2024-09-05 23:08:09 - urllib3.connectionpool - DEBUG: - Starting new HTTP connection (1): 212.129.155.247:80
2024-09-05 23:08:09 - urllib3.connectionpool - DEBUG: - http://212.129.155.247:80 "GET /embedding/roberta-base.zip HTTP/1.1" 404 3650
Traceback (most recent call last):
.......
self.model = _RobertaWordModel(model_dir_or_name=model_dir_or_name, vocab=vocab, layers=layers,
File "/root/miniconda3/lib/python3.10/site-packages/fastNLP/embeddings/roberta_embedding.py", line 215, in init
self.tokenizer = RobertaTokenizer.from_pretrained(model_dir_or_name)
File "/root/miniconda3/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 "/root/miniconda3/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 "/root/miniconda3/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 "/root/miniconda3/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://212.129.155.247/embedding/roberta-base.zip.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions