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
a4ed074d
Unverified
Commit
a4ed074d
authored
Jun 21, 2021
by
Stas Bekman
Committed by
GitHub
Jun 21, 2021
Browse files
reset report_to to none, avoid deprecation warning (#12293)
parent
7ef309ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
tests/test_trainer.py
tests/test_trainer.py
+6
-1
No files found.
tests/test_trainer.py
View file @
a4ed074d
...
@@ -97,6 +97,11 @@ class RegressionTrainingArguments(TrainingArguments):
...
@@ -97,6 +97,11 @@ class RegressionTrainingArguments(TrainingArguments):
a
:
float
=
0.0
a
:
float
=
0.0
b
:
float
=
0.0
b
:
float
=
0.0
def
__post_init__
(
self
):
super
().
__post_init__
()
# save resources not dealing with reporting (also avoids the warning when it's not set)
self
.
report_to
=
[]
class
RepeatDataset
:
class
RepeatDataset
:
def
__init__
(
self
,
x
,
length
=
64
):
def
__init__
(
self
,
x
,
length
=
64
):
...
@@ -374,7 +379,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
...
@@ -374,7 +379,7 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
def
test_training_arguments_are_left_untouched
(
self
):
def
test_training_arguments_are_left_untouched
(
self
):
trainer
=
get_regression_trainer
()
trainer
=
get_regression_trainer
()
trainer
.
train
()
trainer
.
train
()
args
=
TrainingArguments
(
"./regression"
)
args
=
TrainingArguments
(
"./regression"
,
report_to
=
[]
)
dict1
,
dict2
=
args
.
to_dict
(),
trainer
.
args
.
to_dict
()
dict1
,
dict2
=
args
.
to_dict
(),
trainer
.
args
.
to_dict
()
for
key
in
dict1
.
keys
():
for
key
in
dict1
.
keys
():
# Logging dir can be slightly different as they default to something with the time.
# Logging dir can be slightly different as they default to something with the time.
...
...
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