Skip to content

Conversation

@qgallouedec
Copy link
Member

GRPO recently benefited from some improvements in initialization that were not applied to RLOO. This PR aligns the two initializations.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Comment on lines 120 to 131
from datasets import load_dataset
from trl import RLOOTrainer
from trl.rewards import accuracy_reward
dataset = load_dataset("trl-lib/tldr", split="train")
def reward_func(completions, **kwargs):
# Dummy reward function that rewards completions with more unique letters.
return [float(len(set(completion))) for completion in completions]
dataset = load_dataset("trl-lib/DeepMath-103K", split="train")
trainer = RLOOTrainer(
model="Qwen/Qwen2-0.5B-Instruct",
reward_funcs=reward_func,
reward_funcs=accuracy_reward,
train_dataset=dataset,
)
trainer.train()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #4524

model_name = model_name.split("/")[-1]
args = RLOOConfig(f"{model_name}-RLOO")

# Models
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all other changes come from #4577

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants