This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| microgpt2.py | |
| A dependency-free, single-file GPT-style language model in pure Python. | |
| Key properties: | |
| - stdlib only | |
| - explicit forward/backward kernels (no generic scalar autograd) | |
| - flat float32 parameter buffers using array('f') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { YoutubeTranscript } from 'youtube-transcript'; | |
| import puppeteer from 'puppeteer'; | |
| import fs from 'fs/promises'; | |
| import readline from 'readline/promises'; | |
| import * as path from 'path'; | |
| const MAX_CHARS_PER_FILE = 500000; | |
| async function main() { | |
| const rl = readline.createInterface({ |