Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Fairseq
Commits
cc85d411
Commit
cc85d411
authored
Jun 19, 2018
by
Stephen Roller
Committed by
Myle Ott
Jun 21, 2018
Browse files
Fix a bug with using GloVe 840B tokens for initialization.
parent
9dcee4c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
fairseq/utils.py
fairseq/utils.py
+1
-1
No files found.
fairseq/utils.py
View file @
cc85d411
...
@@ -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
.
r
strip
().
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment