Skip to content

RuntimeError: Unsloth: Please file a bug report! Error patching SFTTrainer #1641

Closed

Description

@Kabster17

Currently, running the GRPO code on my local machine but its raises this error:

Image Image

Any workaround of this, have verified all the packages versions with the Google Colab notebook yet this error persists.

Activity

  1. changed the title [-]GRPO - Unsloth SFT Trainer Issue[/-] [+]RuntimeError: Unsloth: Please file a bug report! Error patching SFTTrainer[/+] on Feb 8, 2025
  2. shermansiu commented on Feb 9, 2025

    @shermansiu

    This may be related to huggingface/trl#2405. What's the version of trl you're using?

  3. shermansiu commented on Feb 9, 2025

    @shermansiu

    I think

    args = ",\n".join(f"{' '*8}{key} = {value}" for key, value in args.items())

    should be replaced with

    args = ",\n".join(f"{' '*8}{key} = {value}" if value != inspect._empty else f"{' '*8}{key}" for key, value in args.items())
    

    to fix patch_trl_tokenizer_processing_class.

    Fixing patch_sft_trainer_tokenizer is a lot more work because huggingface/trl#2405 completely changed the structure of SFTTrainer.

    Maybe use pip install git+https://github.com/huggingface/trl.git@e95f9fb74a3c3647b86f251b7e230ec51c64b72b instead of the latest version as the notebook suggests or if you want the latest version that works, pip install git+https://github.com/huggingface/trl.git@82d12eb75103821cd4af1978e99b1026a90ac67d.

  4. Kabster17 commented on Feb 9, 2025

    @Kabster17
    Author

    My trl version is as follows:

    Name: trl
    Version: 0.15.0.dev0
    Summary: Train transformer language models with reinforcement learning.
    Home-page: https://github.com/huggingface/trl
    Author: Leandro von Werra
    Author-email: [email protected]
    License: Apache 2.0
    Location: /home/kabster/anaconda3/envs/unsloth_env/lib/python3.11/site-packages
    Requires: accelerate, datasets, rich, transformers
    Required-by: unsloth, unsloth_zoo

    Attempted the line changes in the tokenizer utils but it raised another error as shown below:

    Image
  5. Kabster17 commented on Feb 9, 2025

    @Kabster17
    Author

    Ok got it sorted after uninstalling trl and re-installing as per your suggestion.
    Thanks!

  6. SanskarX10 commented on Feb 13, 2025

    @SanskarX10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions