Skip to content

Instantly share code, notes, and snippets.

@catorch
catorch / grpo_demo.py
Created January 30, 2025 23:10 — 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
@catorch
catorch / GeneratorDropdown.tsx
Created October 19, 2023 18:13
Current GeneratorDropdown and GeneratorFormInput components styles with error state
import React, { ChangeEvent, useState, FC } from 'react';
interface OptionType {
value: string;
label: string;
}
interface DropdownProps {
options: OptionType[];
value: string;
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, f1_score, classification_report
class ELM(nn.Module):
def __init__(self, input_dim, hidden_dim, output_dim):
super(ELM, self).__init__()
# Install and load the progress package
if (!requireNamespace("progress")) install.packages("progress")
library(progress)
# Generate datasets with different ticket types and status
set.seed(456)
tickets1 <- data.frame(TicketType = sample(c("Type A", "Type B", "Type C", "Type D"), size = 100, replace = TRUE),
Status = sample(c("Open", "Closed"), size = 10, replace = TRUE))
set.seed(42)
@catorch
catorch / financial_projection.ipynb
Created April 9, 2023 20:13
financial_projection.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.