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
3278e854
Commit
3278e854
authored
Nov 01, 2017
by
Myle Ott
Browse files
Fix flake8 lint
parent
56c28099
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
6 deletions
+3
-6
fairseq/data.py
fairseq/data.py
+1
-3
fairseq/models/fairseq_incremental_decoder.py
fairseq/models/fairseq_incremental_decoder.py
+0
-2
interactive.py
interactive.py
+2
-1
No files found.
fairseq/data.py
View file @
3278e854
...
@@ -113,11 +113,9 @@ class LanguageDatasets(object):
...
@@ -113,11 +113,9 @@ class LanguageDatasets(object):
batch_sampler
=
batch_sampler
)
batch_sampler
=
batch_sampler
)
def
eval_dataloader
(
self
,
split
,
num_workers
=
0
,
batch_size
=
1
,
def
eval_dataloader
(
self
,
split
,
num_workers
=
0
,
batch_size
=
1
,
max_tokens
=
None
,
consider_dst_sizes
=
True
,
max_tokens
=
None
,
max_positions
=
(
1024
,
1024
),
max_positions
=
(
1024
,
1024
),
skip_invalid_size_inputs_valid_test
=
False
):
skip_invalid_size_inputs_valid_test
=
False
):
dataset
=
self
.
splits
[
split
]
dataset
=
self
.
splits
[
split
]
dst_dataset
=
dataset
.
dst
if
consider_dst_sizes
else
None
batch_sampler
=
list
(
batches_by_size
(
batch_sampler
=
list
(
batches_by_size
(
dataset
.
src
,
dataset
.
dst
,
batch_size
,
max_tokens
,
dataset
.
src
,
dataset
.
dst
,
batch_size
,
max_tokens
,
max_positions
=
max_positions
,
max_positions
=
max_positions
,
...
...
fairseq/models/fairseq_incremental_decoder.py
View file @
3278e854
...
@@ -6,8 +6,6 @@
...
@@ -6,8 +6,6 @@
# can be found in the PATENTS file in the same directory.
# can be found in the PATENTS file in the same directory.
#
#
import
torch.nn
as
nn
from
.
import
FairseqDecoder
from
.
import
FairseqDecoder
...
...
interactive.py
View file @
3278e854
...
@@ -10,7 +10,7 @@ import sys
...
@@ -10,7 +10,7 @@ import sys
import
torch
import
torch
from
torch.autograd
import
Variable
from
torch.autograd
import
Variable
from
fairseq
import
data
,
options
,
tokenizer
,
utils
from
fairseq
import
options
,
tokenizer
,
utils
from
fairseq.sequence_generator
import
SequenceGenerator
from
fairseq.sequence_generator
import
SequenceGenerator
...
@@ -73,5 +73,6 @@ def main():
...
@@ -73,5 +73,6 @@ def main():
print
(
'A
\t
{}'
.
format
(
' '
.
join
(
map
(
str
,
alignment
))))
print
(
'A
\t
{}'
.
format
(
' '
.
join
(
map
(
str
,
alignment
))))
print
(
'H
\t
{}
\t
{}'
.
format
(
hypo
[
'score'
],
hypo_str
))
print
(
'H
\t
{}
\t
{}'
.
format
(
hypo
[
'score'
],
hypo_str
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
main
()
main
()
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