Commit cc85d411 authored by Stephen Roller's avatar Stephen Roller Committed by Myle Ott
Browse files

Fix a bug with using GloVe 840B tokens for initialization.

parent 9dcee4c7
...@@ -256,7 +256,7 @@ def parse_embedding(embed_path): ...@@ -256,7 +256,7 @@ def parse_embedding(embed_path):
with open(embed_path) as f_embed: with open(embed_path) as f_embed:
next(f_embed) # skip header next(f_embed) # skip header
for line in f_embed: for line in f_embed:
pieces = line.strip().split() pieces = line.rstrip().split(" ")
embed_dict[pieces[0]] = torch.Tensor([float(weight) for weight in pieces[1:]]) embed_dict[pieces[0]] = torch.Tensor([float(weight) for weight in pieces[1:]])
return embed_dict return embed_dict
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment