Skip to content

So many bugs in the new version code #64

Open

Description

@yangluo23

There seems so many bugs in the new version code, e.g., issue63, trainer.

Activity

  1. Aurora-1412 commented on Mar 13, 2025

    @Aurora-1412

    Same error. For padding_side error, it seems a bug from trl repos, like this issue

  2. tsrigo commented on Mar 13, 2025

    @tsrigo

    yes, i meet GRPOConfig' object has no attribute 'num_iterations'

  3. ShuoZheLi commented on Mar 18, 2025

    @ShuoZheLi

    Working src/x_r1/configs.py

    # coding=utf-8
    # Copyright 2025 The HuggingFace Team. All rights reserved.
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #     http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    from dataclasses import dataclass, field
    from typing import Optional
    
    import trl
    
    
    # TODO: add the shared options with a mixin to reduce code duplication
    @dataclass
    class GRPOConfig(trl.GRPOConfig):
        """
        args for callbacks, benchmarks etc
        """
    
        benchmarks: list[str] = field(
            default_factory=lambda: [], metadata={"help": "The benchmarks to run after training."}
        )
        callbacks: list[str] = field(
            default_factory=lambda: [], metadata={"help": "The callbacks to run during training."}
        )
        system_prompt: Optional[str] = field(
            default=None, metadata={"help": "The optional system prompt to use for benchmarking."}
        )
        hub_model_revision: Optional[str] = field(
            default="main", metadata={"help": "The Hub model branch to push the model to."}
        )
        overwrite_hub_revision: bool = field(default=False, metadata={"help": "Whether to overwrite the Hub revision."})
        push_to_hub_revision: bool = field(default=False, metadata={"help": "Whether to push to a Hub revision/branch."})
        wandb_entity: Optional[str] = field(
            default=None,
            metadata={"help": ("The entity to store runs under.")},
        )
        wandb_project: Optional[str] = field(
            default=None,
            metadata={"help": ("The project to store runs under.")},
        )
    
        num_iterations: Optional[int] = field(
            default=1,
            metadata={
                "help": "𝜇 for GRPO, num of update per advantage."
            },
        )
    
        epsilon: Optional[float] = field(
            default=1,
            metadata={
                "help": "ɛ clipping threshold that limits how much the ratio between the new policy’s probability and the old policy’s probability can change."
            },
        )
    
    
    @dataclass
    class SFTConfig(trl.SFTConfig):
        """
        args for callbacks, benchmarks etc
        """
    
        benchmarks: list[str] = field(
            default_factory=lambda: [], metadata={"help": "The benchmarks to run after training."}
        )
        callbacks: list[str] = field(
            default_factory=lambda: [], metadata={"help": "The callbacks to run during training."}
        )
        system_prompt: Optional[str] = field(
            default=None,
            metadata={"help": "The optional system prompt to use for benchmarking."},
        )
        hub_model_revision: Optional[str] = field(
            default="main",
            metadata={"help": "The Hub model branch to push the model to."},
        )
        overwrite_hub_revision: bool = field(default=False, metadata={"help": "Whether to overwrite the Hub revision."})
        push_to_hub_revision: bool = field(default=False, metadata={"help": "Whether to push to a Hub revision/branch."})
        wandb_entity: Optional[str] = field(
            default=None,
            metadata={"help": ("The entity to store runs under.")},
        )
        wandb_project: Optional[str] = field(
            default=None,
            metadata={"help": ("The project to store runs under.")},
        )
    
    
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions