Skip to content

Instantly share code, notes, and snippets.

@2nd-ren
2nd-ren / grpo_demo.py
Created January 30, 2025 22:34 — 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
window.theme = window.theme || {};
window.slate = window.slate || {};
/* ================ SLATE ================ */
theme.Sections = function Sections() {
this.constructors = {};
this.instances = [];
$(document)
.on('shopify:section:load', this._onSectionLoad.bind(this))