Skip to content

Instantly share code, notes, and snippets.

View emezac's full-sized avatar

Enrique Meza C emezac

View GitHub Profile
@emezac
emezac / grpo_demo.py
Created January 30, 2025 22:29 — 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
@emezac
emezac / sorcery.rb
Created December 13, 2021 03:52 — forked from reqshark/sorcery.rb
sorcery config file
Rails.application.config.sorcery.submodules = [:reset_password, :activity_logging, :external, :remember_me]
Rails.application.config.sorcery.configure do |config|
config.not_authenticated_action = :not_authenticated
config.save_return_to_url = true
config.cookie_domain = sorcery.kickr.io
# -- session timeout --
# config.session_timeout = 3600
# config.session_timeout_from_last_action = false
# -- activity logging --
@emezac
emezac / leader-election.md
Created November 8, 2019 18:48 — forked from andrewle/leader-election.md
Leader Election With Ruby & PostgreSQL

Leader Election With Ruby & PostgreSQL

The Problem

I have a table with millions of rows that needs processing. The type of processing is not really important for this article. We simply need to process some data with Ruby --or any other user-space programming language.

A Solution

@emezac
emezac / index.md
Created August 26, 2019 20:15 — forked from rstacruz/index.md
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one