Skip to content

Instantly share code, notes, and snippets.

View Karamann's full-sized avatar
🔩

Nick Karaman Karamann

🔩
View GitHub Profile
@willccbb
willccbb / grpo_demo.py
Last active April 18, 2025 10:30
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