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
chenpangpang
transformers
Commits
0c17e766
Unverified
Commit
0c17e766
authored
Jan 31, 2022
by
Sylvain Gugger
Committed by
GitHub
Jan 31, 2022
Browse files
Error when group_by_length is used with an IterableDataset (#15437)
parent
125a2882
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
src/transformers/trainer.py
src/transformers/trainer.py
+7
-0
No files found.
src/transformers/trainer.py
View file @
0c17e766
...
...
@@ -422,6 +422,13 @@ class Trainer:
if
train_dataset
is
not
None
and
not
isinstance
(
train_dataset
,
collections
.
abc
.
Sized
)
and
args
.
max_steps
<=
0
:
raise
ValueError
(
"train_dataset does not implement __len__, max_steps has to be specified"
)
if
(
train_dataset
is
not
None
and
isinstance
(
train_dataset
,
torch
.
utils
.
data
.
IterableDataset
)
and
args
.
group_by_length
):
raise
ValueError
(
"the `--group_by_length` option is only available for `Dataset`, not `IterableDataset"
)
self
.
_signature_columns
=
None
# Mixed precision setup
...
...
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