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
69873d52
Unverified
Commit
69873d52
authored
Oct 11, 2023
by
Sourab Mangrulkar
Committed by
GitHub
Oct 11, 2023
Browse files
fix the model card issue as `use_cuda_amp` is no more available (#26731)
parent
cc44ca80
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/transformers/modelcard.py
src/transformers/modelcard.py
+3
-3
No files found.
src/transformers/modelcard.py
View file @
69873d52
...
@@ -895,10 +895,10 @@ def extract_hyperparameters_from_trainer(trainer):
...
@@ -895,10 +895,10 @@ def extract_hyperparameters_from_trainer(trainer):
hyperparameters
[
"num_epochs"
]
=
trainer
.
args
.
num_train_epochs
hyperparameters
[
"num_epochs"
]
=
trainer
.
args
.
num_train_epochs
if
trainer
.
args
.
fp16
:
if
trainer
.
args
.
fp16
:
if
trainer
.
use_cuda_amp
:
if
trainer
.
use_apex
:
hyperparameters
[
"mixed_precision_training"
]
=
"Native AMP"
elif
trainer
.
use_apex
:
hyperparameters
[
"mixed_precision_training"
]
=
f
"Apex, opt level
{
trainer
.
args
.
fp16_opt_level
}
"
hyperparameters
[
"mixed_precision_training"
]
=
f
"Apex, opt level
{
trainer
.
args
.
fp16_opt_level
}
"
else
:
hyperparameters
[
"mixed_precision_training"
]
=
"Native AMP"
if
trainer
.
args
.
label_smoothing_factor
!=
0.0
:
if
trainer
.
args
.
label_smoothing_factor
!=
0.0
:
hyperparameters
[
"label_smoothing_factor"
]
=
trainer
.
args
.
label_smoothing_factor
hyperparameters
[
"label_smoothing_factor"
]
=
trainer
.
args
.
label_smoothing_factor
...
...
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