Skip to content

[Question] Log eval metrics performed during training to files #2602

@skandermoalla

Description

@skandermoalla

In the example scripts there is a final trainer.evaluate that performs a last evaluation and outputs eval metrics that are saved to a file with other calls like trainer.save_metrics (https://github.com/huggingface/trl/blob/d4222a1e08def2be56572eb2973ef3bf50143a4f/trl/scripts/dpo.py#L128C1-L131C46).

    if training_args.eval_strategy != "no":
        metrics = trainer.evaluate()
        trainer.log_metrics("eval", metrics)
        trainer.save_metrics("eval", metrics)

Is there a way to save these metrics to files during the regular evaluations performed by the trainer too? I coudn't find anything in the TrainingArguments.
Also are the metrics logged during these eval to W&B accumulated over the whole eval dataset or refer to a single eval batch?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❓ questionSeeking clarification or more information📚 documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions