Skip to content

Commit

Permalink
fix(hf): pass fake eval dataset since it is required (#853)
Browse files Browse the repository at this point in the history
  • Loading branch information
shcheklein authored Dec 19, 2024
1 parent a15bb31 commit dac96b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dvclive/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def on_train_end(
):
if self._log_model is True and state.is_world_process_zero:
fake_trainer = Trainer(
args=args, model=kwargs.get("model"), tokenizer=kwargs.get("tokenizer")
args=args,
model=kwargs.get("model"),
tokenizer=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)
Expand Down
1 change: 1 addition & 0 deletions tests/frameworks/test_huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def test_huggingface_log_model(
live_callback = callback(live=live, log_model=log_model)

args.load_best_model_at_end = best
args.metric_for_best_model = "loss"

trainer = Trainer(
model,
Expand Down

0 comments on commit dac96b2

Please sign in to comment.