From fa831423b3cee14e04f10e09f265c7d6530c2989 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 18 Feb 2025 00:05:40 -0800 Subject: [PATCH] Update rl.py --- unsloth/models/rl.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py index 3b7b88b6c3..231dbe7765 100644 --- a/unsloth/models/rl.py +++ b/unsloth/models/rl.py @@ -442,12 +442,6 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"): # Selective log softmax selective_log_softmax_code = inspect.getsource(selective_log_softmax) - # Trainer kwargs - comma = "" if RLTrainer_call_args.endswith(",") else "," - unsloth_extra_args = comma + \ - "vllm_sampling_params = vllm_sampling_params,\n"\ - "unsloth_num_chunks = unsloth_num_chunks, **kwargs" - # Get final source code RLTrainer_source = RLTrainer_replacement.format( RLTrainer_name = RLTrainer_name, @@ -455,14 +449,14 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"): RLTrainer_arguments = RLTrainer_arguments, RLTrainer_extra_args = RLTrainer_extra_args, RLTrainer_call_args = RLTrainer_call_args, - RLTrainer_kwargs = ",**kwargs"[1 if RLTrainer_call_args .endswith(",") else 0:], + RLTrainer_kwargs = ",**kwargs"[1 if RLTrainer_call_args.endswith(",") else 0:], RLConfig_name = RLConfig_name, __RLConfig_doc__ = __RLConfig_doc__, RLConfig_arguments = RLConfig_arguments, RLConfig_extra_args = RLConfig_extra_args, RLConfig_call_args = RLConfig_call_args, - RLConfig_kwargs = unsloth_extra_args, + RLConfig_kwargs = ",**kwargs"[1 if RLConfig_call_args .endswith(",") else 0:], RLTrainer_extras = RLTrainer_extras, RLTrainer_post = RLTrainer_post,