Skip to content

Instantly share code, notes, and snippets.

@samdobson
samdobson / generate_cpu.py
Created October 14, 2025 01:37 — forked from simonw/generate_cpu.py
Claude Code generated script for running nanochat models on CPU on macOS
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "torch",
# "tiktoken",
# "numpy",
# ]
# ///
"""
Standalone CPU-compatible text generation for the nanochat model.