Skip to content

Instantly share code, notes, and snippets.

View JGalego's full-sized avatar
🧠
𝙶̶𝙿̶𝚄̶𝚜̶ brains go brrr

João Galego JGalego

🧠
𝙶̶𝙿̶𝚄̶𝚜̶ brains go brrr
View GitHub Profile
@JGalego
JGalego / rljf_grpo.py
Last active October 14, 2026 10:17
RLJF = RLHF - Humans + Jev 🎰 GRPO fine-tuning with TypeSafe's Jev as the reward model
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "trl>=1.13", "peft>=0.21", "transformers>=5.0", "datasets>=4.0",
# "accelerate>=1.0", "torch>=2.4", "typesafe-sdk>=0.7", "python-dotenv>=1.0",
# ]
# ///
"""RLJF: GRPO fine-tuning with TypeSafe's Jev as the reward model.
@mplekh
mplekh / tapegpt.py
Last active March 12, 2026 00:43
Karpathy's microgpt modified to use Wengert Tape architecture (Flat Array of Values instead of Graph of Objects)
import math
import random
random.seed(42)
# -----------------------------------------------------------------------------
# Tape-based Autograd Engine
# -----------------------------------------------------------------------------
class Tape:
# /// script
# dependencies = [
# "requests<3",
# "rich",
# ]
# ///
# Code to reveal the easter egg in the Gemini 2.5 paper (https://www.arxiv.org/abs/2507.06261)
# Take the first letter of each author to spell out
# "GEMINI MODELS CANT THINK AND GET BACK TO YOU IN A FLASH"
@JGalego
JGalego / hopfield.py
Last active September 15, 2025 14:47
Implementation of a traditional Hopfield network in Python 🧠
# pylint: disable=invalid-name,non-ascii-name,line-too-long
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "numpy",
# "matplotlib",
# "Pillow",
# ]
# ///