Understand the nanochat file structure
masterThe nanochat repository is organized into several functional directories that separate core logic, training scripts, evaluation tasks, and execution scripts:
nanochat/: The core library containing the model architecture (gpt.py), inference engine (engine.py), optimizer (optim.py), tokenizer (tokenizer.py), and data utilities (dataloader.py,dataset.py).scripts/: High-level entry points for users, includingchat_cli.pyfor interactive chat,base_train.pyfor pretraining,chat_sft.pyfor supervised fine-tuning, andinfer_bench.pyfor performance benchmarking.tasks/: Definitions for evaluation datasets and task mixtures (e.g.,arc.py,gsm8k.py,mmlu.py).runs/: Shell scripts for reproducible experiments, such asspeedrun.shfor fast training orruncpu.shfor CPU/MPS execution.tests/: Unit tests for core components like the inference engine, optimizer, and tokenizer.