Skip to content

Instantly share code, notes, and snippets.

View skrawcz's full-sized avatar

Stefan Krawczyk skrawcz

View GitHub Profile
@karpathy
karpathy / microgpt.py
Last active February 12, 2026 07:37
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
@elijahbenizzy
elijahbenizzy / metrics_layer.py
Created September 15, 2022 00:19
Metrics Layer using Hamilton
### metrics_layer.py
import pandas as pd
from hamilton import driver
def workspaces(db: str, table: str='workspaces') -> pd.DataFrame:
return query("SELECT * from {db}.{table}".format(db))
def count_workspaces(workspaces: pd.DataFrame, grain: str) -> pd.Series:
"""Pandas code that does...