Optimized for local training on your M3 iMac using Metal Performance Shaders (MPS).
Open your terminal and install the required Python packages:
pip install torch numpy transformers datasets tiktoken wandb tqdm
Download and tokenize the Shakespeare character dataset:
python data/shakespeare_char/prepare.py
Train your character-level GPT using your Mac's integrated GPU hardware acceleration:
python train.py config/train_shakespeare_char.py --device=mps --compile=False
Generate text samples from your newly trained checkpoint:
python sample.py --out_dir=out-shakespeare-char --device=mps