Skip to content

Commit

Permalink
fix(dvclive): pass fake dataset to avoid exception in trainer init (h…
Browse files Browse the repository at this point in the history
…uggingface#34455)

fix(dvclive): pass fake dataset to avoid exception in trainer
  • Loading branch information
shcheklein authored Nov 7, 2024
1 parent 7bbc624 commit 6938524
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/transformers/integrations/integration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,12 @@ def on_train_end(self, args, state, control, **kwargs):
from transformers.trainer import Trainer

if self._log_model is True:
fake_trainer = Trainer(args=args, model=kwargs.get("model"), processing_class=kwargs.get("tokenizer"))
fake_trainer = Trainer(
args=args,
model=kwargs.get("model"),
processing_class=kwargs.get("tokenizer"),
eval_dataset=["fake"],
)
name = "best" if args.load_best_model_at_end else "last"
output_dir = os.path.join(args.output_dir, name)
fake_trainer.save_model(output_dir)
Expand Down

0 comments on commit 6938524

Please sign in to comment.