mirror of
https://gitee.com/fastnlp/fastNLP.git
synced 2024-12-02 04:07:35 +08:00
update travis
This commit is contained in:
parent
edd3022bde
commit
ba2304556c
@ -1,6 +1,10 @@
|
||||
language: python
|
||||
python:
|
||||
- "3.6"
|
||||
|
||||
env:
|
||||
- TRAVIS=1
|
||||
|
||||
# command to install dependencies
|
||||
install:
|
||||
- pip install --quiet -r requirements.txt
|
||||
|
@ -280,6 +280,8 @@ class StaticEmbedding(TokenEmbedding):
|
||||
found_unknown = True
|
||||
if word in vocab:
|
||||
index = vocab.to_index(word)
|
||||
if index in matrix:
|
||||
warnings.warn(f"Word:{word} occurs again in line:{idx}(starts from 0)")
|
||||
matrix[index] = torch.from_numpy(np.fromstring(' '.join(nums), sep=' ', dtype=dtype, count=dim))
|
||||
if self.only_norm_found_vector:
|
||||
matrix[index] = matrix[index] / np.linalg.norm(matrix[index])
|
||||
|
Loading…
Reference in New Issue
Block a user