Skip to content

Instantly share code, notes, and snippets.

View zainhas's full-sized avatar
:electron:
learning new things...

Zain Hasan zainhas

:electron:
learning new things...
View GitHub Profile
@willccbb
willccbb / grpo_demo.py
Last active April 21, 2025 18:48
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