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
bf47b956
Commit
bf47b956
authored
May 17, 2018
by
Alexei Baevski
Committed by
Myle Ott
Jun 15, 2018
Browse files
also report sentence/s timing when generating
parent
67af40c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
generate.py
generate.py
+2
-2
No files found.
generate.py
View file @
bf47b956
...
...
@@ -157,8 +157,8 @@ def main(args):
t
.
log
({
'wps'
:
round
(
wps_meter
.
avg
)})
num_sentences
+=
1
print
(
'| Translated {} sentences ({} tokens) in {:.1f}s ({:.2f} tokens/s)'
.
format
(
num_sentences
,
gen_timer
.
n
,
gen_timer
.
sum
,
1.
/
gen_timer
.
avg
))
print
(
'| Translated {} sentences ({} tokens) in {:.1f}s ({:.2f}
sentences/s, {:.2f}
tokens/s)'
.
format
(
num_sentences
,
gen_timer
.
n
,
gen_timer
.
sum
,
num_sentences
/
gen_timer
.
sum
,
1.
/
gen_timer
.
avg
))
if
has_target
:
print
(
'| Generate {} with beam={}: {}'
.
format
(
args
.
gen_subset
,
args
.
beam
,
scorer
.
result_string
()))
...
...
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