Skip to content

Instantly share code, notes, and snippets.

View GrubBox's full-sized avatar

Sandeep GrubBox

  • Freelancer
  • Location : FreeWorld
  • 10:58 (UTC +05:30)
View GitHub Profile
@willccbb
willccbb / grpo_demo.py
Last active April 18, 2025 01:17
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer