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
587197dc
Unverified
Commit
587197dc
authored
Feb 15, 2021
by
Sylvain Gugger
Committed by
GitHub
Feb 15, 2021
Browse files
Fix datasets set_format (#10178)
parent
8fae93ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/transformers/trainer.py
src/transformers/trainer.py
+2
-1
No files found.
src/transformers/trainer.py
View file @
587197dc
...
@@ -439,7 +439,8 @@ class Trainer:
...
@@ -439,7 +439,8 @@ class Trainer:
f
"The following columns
{
dset_description
}
don't have a corresponding argument in "
f
"The following columns
{
dset_description
}
don't have a corresponding argument in "
f
"`
{
self
.
model
.
__class__
.
__name__
}
.forward` and have been ignored:
{
', '
.
join
(
ignored_columns
)
}
."
f
"`
{
self
.
model
.
__class__
.
__name__
}
.forward` and have been ignored:
{
', '
.
join
(
ignored_columns
)
}
."
)
)
dataset
.
set_format
(
type
=
dataset
.
format
[
"type"
],
columns
=
columns
)
dataset
.
set_format
(
type
=
dataset
.
format
[
"type"
],
columns
=
columns
,
format_kwargs
=
dataset
.
format
[
"format_kwargs"
])
def
_get_train_sampler
(
self
)
->
Optional
[
torch
.
utils
.
data
.
sampler
.
Sampler
]:
def
_get_train_sampler
(
self
)
->
Optional
[
torch
.
utils
.
data
.
sampler
.
Sampler
]:
if
isinstance
(
self
.
train_dataset
,
torch
.
utils
.
data
.
IterableDataset
)
or
not
isinstance
(
if
isinstance
(
self
.
train_dataset
,
torch
.
utils
.
data
.
IterableDataset
)
or
not
isinstance
(
...
...
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