mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-17 12:20:37 +08:00
[misc] fix packing and eval plot (#7623)
This commit is contained in:
@@ -82,7 +82,13 @@ def run_kto(
|
||||
trainer.save_metrics("train", train_result.metrics)
|
||||
trainer.save_state()
|
||||
if trainer.is_world_process_zero() and finetuning_args.plot_loss:
|
||||
plot_loss(training_args.output_dir, keys=["loss", "eval_loss", "rewards/chosen"])
|
||||
keys = ["loss", "rewards/chosen"]
|
||||
if isinstance(dataset_module["eval_dataset"], dict):
|
||||
keys += [f"eval_{key}_loss" for key in dataset_module["eval_dataset"].keys()]
|
||||
else:
|
||||
keys += ["eval_loss"]
|
||||
|
||||
plot_loss(training_args.output_dir, keys=keys)
|
||||
|
||||
# Evaluation
|
||||
if training_args.do_eval:
|
||||
|
||||
Reference in New Issue
Block a user