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
0714080b
"src/vscode:/vscode.git/clone" did not exist on "6e2a93de70047353b6a9e9bc44ee89033d074911"
Commit
0714080b
authored
Sep 05, 2018
by
Stephen Roller
Committed by
Myle Ott
Sep 25, 2018
Browse files
Sequence generator bug fix.
parent
e6d45d5c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
fairseq/sequence_generator.py
fairseq/sequence_generator.py
+2
-2
No files found.
fairseq/sequence_generator.py
View file @
0714080b
...
@@ -84,9 +84,9 @@ class SequenceGenerator(object):
...
@@ -84,9 +84,9 @@ class SequenceGenerator(object):
with
torch
.
no_grad
():
with
torch
.
no_grad
():
hypos
=
self
.
generate
(
hypos
=
self
.
generate
(
beam_size
=
beam_size
,
beam_size
=
beam_size
,
maxlen
=
int
(
maxlen_a
*
srclen
+
maxlen_b
maxlen
=
int
(
maxlen_a
*
srclen
+
maxlen_b
),
**
net_input
),
prefix_tokens
=
s
[
'target'
][:,
:
prefix_size
]
if
prefix_size
>
0
else
None
,
prefix_tokens
=
s
[
'target'
][:,
:
prefix_size
]
if
prefix_size
>
0
else
None
,
**
net_input
,
)
)
if
timer
is
not
None
:
if
timer
is
not
None
:
timer
.
stop
(
sum
(
len
(
h
[
0
][
'tokens'
])
for
h
in
hypos
))
timer
.
stop
(
sum
(
len
(
h
[
0
][
'tokens'
])
for
h
in
hypos
))
...
...
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