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
33469436
"vscode:/vscode.git/clone" did not exist on "9c05c6898e262b1f7dd07b1401918be2d48fe4e2"
Commit
33469436
authored
Jan 18, 2018
by
Myle Ott
Browse files
Better warning message for inputs that are too long
parent
66314a60
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
fairseq/data.py
fairseq/data.py
+4
-3
No files found.
fairseq/data.py
View file @
33469436
...
...
@@ -297,9 +297,10 @@ def _make_batches(src, dst, indices, max_tokens, max_sentences, max_positions,
if
ignore_invalid_inputs
:
ignored
.
append
(
idx
)
continue
raise
Exception
(
"Unable to handle input id {} of size {} / {}."
.
format
(
idx
,
src
.
sizes
[
idx
],
dst
.
sizes
[
idx
]))
raise
Exception
((
"Sample #{} has size (src={}, dst={}) but max size is {}."
" Skip this example with --skip-invalid-size-inputs-valid-test"
).
format
(
idx
,
src
.
sizes
[
idx
],
dst
.
sizes
[
idx
],
max_positions
))
sample_len
=
max
(
sample_len
,
src
.
sizes
[
idx
],
dst
.
sizes
[
idx
])
num_tokens
=
(
len
(
batch
)
+
1
)
*
sample_len
...
...
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