From 595fc1d455c57de2b27d144e89992f2493527293 Mon Sep 17 00:00:00 2001 From: LouChao98 <523824504@qq.com> Date: Thu, 22 Apr 2021 09:57:46 +0800 Subject: [PATCH] mirror fix (#361) --- fastNLP/embeddings/static_embedding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastNLP/embeddings/static_embedding.py b/fastNLP/embeddings/static_embedding.py index 81c0fe42..09c44d6c 100644 --- a/fastNLP/embeddings/static_embedding.py +++ b/fastNLP/embeddings/static_embedding.py @@ -170,7 +170,7 @@ class StaticEmbedding(TokenEmbedding): if model_path: embedding = self._load_with_vocab(model_path, vocab=lowered_vocab, init_method=init_method) else: - embedding = self._randomly_init_embed(len(vocab), embedding_dim, init_method) + embedding = self._randomly_init_embed(len(lowered_vocab), embedding_dim, init_method) self.register_buffer('words_to_words', torch.arange(len(vocab)).long()) if lowered_vocab.unknown: unknown_idx = lowered_vocab.unknown_idx