Skip to content

Instantly share code, notes, and snippets.

View yaashwardhan's full-sized avatar
🧿

Yashwardhan Deshmukh yaashwardhan

🧿
  • Max Planck Institute for Intelligent Systems
  • Stuttgart, Germany
  • 18:57 (UTC +02:00)
  • LinkedIn in/yaashwardhan
View GitHub Profile
@yaashwardhan
yaashwardhan / grpo_demo.py
Created February 1, 2025 11:51 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset