Browse Source

Merge branch 'dev' of github.com:fastnlp/fastNLP into dev

tags/v1.0.0alpha
yh_cc 3 years ago
parent
commit
a5d608c781
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      fastNLP/embeddings/static_embedding.py

+ 1
- 1
fastNLP/embeddings/static_embedding.py View File

@@ -170,7 +170,7 @@ class StaticEmbedding(TokenEmbedding):
if model_path: if model_path:
embedding = self._load_with_vocab(model_path, vocab=lowered_vocab, init_method=init_method) embedding = self._load_with_vocab(model_path, vocab=lowered_vocab, init_method=init_method)
else: 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()) self.register_buffer('words_to_words', torch.arange(len(vocab)).long())
if lowered_vocab.unknown: if lowered_vocab.unknown:
unknown_idx = lowered_vocab.unknown_idx unknown_idx = lowered_vocab.unknown_idx


Loading…
Cancel
Save