Skip to content

Instantly share code, notes, and snippets.

View acutmore's full-sized avatar

Ashley Claymore acutmore

View GitHub Profile
@karpathy
karpathy / microgpt.py
Last active February 13, 2026 07:48
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@mhofman
mhofman / wrapper-registry.d.ts
Last active December 8, 2021 18:42
Wrap any value into a registered object
export declare class Wrapper<Kind, Value = any> {
private kind: Kind;
private value: Value;
}
export interface WrapperRegistry<Kind> extends Function {
constructor: WrapperRegistryConstructor;
wrap<T>(value: T): Wrapper<Kind, T>;
unwrap<T>(wrapped: Wrapper<Kind, T>): T;
}