HTTPError occurred while downloading embedding vector 'en-glove-840b-300d'
PhSe-coder opened this issue · 1 comments
PhSe-coder commented
Got error message while running following code from Part II: 使用预训练的静态embedding
import torch
from fastNLP.embeddings import StaticEmbedding
from fastNLP import Vocabulary
vocab = Vocabulary()
vocab.add_word_lst("this is a demo .".split())
embed = StaticEmbedding(vocab, model_dir_or_name='en-glove-840b-300d')
words = torch.LongTensor([[vocab.to_index(word) for word in "this is a demo .".split()]]) # 将文本转为index
print(embed(words).size()) # StaticEmbedding的使用和pytorch的nn.Embedding是类似的
Error message:
HTTPError: Status code:404. Fail to download from http://download.fastnlp.top/embedding/glove.840B.300d.zip.
yhcc commented