From baee06f2e83343005dd64f7368ec089281ec80e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Gallou=C3=A9dec?= <45557362+qgallouedec@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:05:25 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=96=8B=EF=B8=8F=20Fix=20warning=20message?= =?UTF-8?q?=20formatting=20in=20`KTOTrainer`=20(#2394)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trl/trainer/kto_trainer.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/trl/trainer/kto_trainer.py b/trl/trainer/kto_trainer.py index 303b65e715..309a2c220a 100644 --- a/trl/trainer/kto_trainer.py +++ b/trl/trainer/kto_trainer.py @@ -729,12 +729,12 @@ def make_inputs_require_grad(module, input, output): if not (des_weight_in_range or und_weight_in_range): warnings.warn( - f""" - You have different amounts of desirable/positive and undesirable/negative examples but the - weights on the desirable and undesirable losses don't seem to be in an ideal range. Based - on your data, we recommend EITHER desirable_weight in [{des_weight_lower_bound}, {des_weight_upper_bound}] - or undesirable_weight in [{und_weight_lower_bound}, {und_weight_upper_bound}] (but NOT BOTH). - See the documentation on how to optimally set these weights.""", + "You have different amounts of desirable/positive and undesirable/negative examples but the " + "weights on the desirable and undesirable losses don't seem to be in an ideal range. Based " + f"on your data, we recommend EITHER " + f"desirable_weight in [{des_weight_lower_bound}, {des_weight_upper_bound}] or " + f"undesirable_weight in [{und_weight_lower_bound}, {und_weight_upper_bound}] (but NOT BOTH). " + "See the documentation on how to optimally set these weights.", UserWarning, )