Update rl.py

This commit is contained in:
Daniel Han 2025-03-05 03:24:08 -08:00
commit d72d014a2c

View file

@ -60,7 +60,7 @@ def PatchRL(FastLanguageModel):
def unsloth_unwrap_model_for_generation(model, *args, **kwargs):
with unwrap_model_for_generation(model, *args, **kwargs) as unwrapped_model:
# Put the model in inference mode.
FastLanguageModel.for_inference(unwrapped_model)
FastLanguageModel.for_inference(model)
# We must use .clone for Unsloth since we force inference_mode
# Rather we should have used no_grad