chore: simplify if condition

This commit is contained in:
NanoCode012
2025-05-23 12:28:34 +07:00
parent 152d0b67d2
commit 255acd3da2

View File

@@ -179,9 +179,8 @@ class HFRLTrainerBuilder(TrainerBuilderBase):
"optimizer_cls_and_kwargs"
)
if self.cfg.rl is RLType.IPO:
if self.cfg.dpo_label_smoothing:
trainer_kwargs["label_smoothing"] = self.cfg.dpo_label_smoothing
if self.cfg.rl is RLType.IPO and self.cfg.dpo_label_smoothing:
trainer_kwargs["label_smoothing"] = self.cfg.dpo_label_smoothing
if self.eval_dataset:
trainer_kwargs["eval_dataset"] = self.eval_dataset
if self.cfg.adapter and self.peft_config: