Skip to content

Commit

Permalink
fix the model card issue as use_cuda_amp is no more available (#26731)
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman100 authored Oct 11, 2023
1 parent cc44ca8 commit 69873d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/transformers/modelcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,10 +895,10 @@ def extract_hyperparameters_from_trainer(trainer):
hyperparameters["num_epochs"] = trainer.args.num_train_epochs

if trainer.args.fp16:
if trainer.use_cuda_amp:
hyperparameters["mixed_precision_training"] = "Native AMP"
elif trainer.use_apex:
if trainer.use_apex:
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:
hyperparameters["label_smoothing_factor"] = trainer.args.label_smoothing_factor
Expand Down

0 comments on commit 69873d5

Please sign in to comment.