Skip to content

Commit baee06f

Browse files
authored
🖋️ Fix warning message formatting in KTOTrainer (huggingface#2394)
1 parent bbd8cbb commit baee06f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

trl/trainer/kto_trainer.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -729,12 +729,12 @@ def make_inputs_require_grad(module, input, output):
729729

730730
if not (des_weight_in_range or und_weight_in_range):
731731
warnings.warn(
732-
f"""
733-
You have different amounts of desirable/positive and undesirable/negative examples but the
734-
weights on the desirable and undesirable losses don't seem to be in an ideal range. Based
735-
on your data, we recommend EITHER desirable_weight in [{des_weight_lower_bound}, {des_weight_upper_bound}]
736-
or undesirable_weight in [{und_weight_lower_bound}, {und_weight_upper_bound}] (but NOT BOTH).
737-
See the documentation on how to optimally set these weights.""",
732+
"You have different amounts of desirable/positive and undesirable/negative examples but the "
733+
"weights on the desirable and undesirable losses don't seem to be in an ideal range. Based "
734+
f"on your data, we recommend EITHER "
735+
f"desirable_weight in [{des_weight_lower_bound}, {des_weight_upper_bound}] or "
736+
f"undesirable_weight in [{und_weight_lower_bound}, {und_weight_upper_bound}] (but NOT BOTH). "
737+
"See the documentation on how to optimally set these weights.",
738738
UserWarning,
739739
)
740740

0 commit comments

Comments
 (0)