NanoGPT Tutorial:修订间差异

来自WHY42
(Created page with "<syntaxhighlight lang="bash"> (base) ➜ nanoGPT git:(master) python data/shakespeare_char/prepare.py length of dataset in characters: 1,115,394 all the unique characters: !$&',-.3:;?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz vocab size: 65 train has 1,003,854 tokens val has 111,540 tokens </syntaxhighlight> <syntaxhighlight lang="bash"> python train.py config/train_shakespeare_char.py # Run it without GPU (mac air), pytorch nightly # raise AssertionError("...")
 
无编辑摘要
第15行: 第15行:
# raise AssertionError("Torch not compiled with CUDA enabled")
# raise AssertionError("Torch not compiled with CUDA enabled")
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="bash">
python train.py config/train_shakespeare_char.py --device=cpu --compile=False --eval_iters=20 --log_interval=1 --block_size=64 --batch_size=12 --n_layer=4 --n_head=4 --n_embd=128 --max_iters=2000 --lr_decay_iters=2000 --dropout=0.0
</syntaxhighlight>
[[Category:Deep Learning]]
[[Category:PyTorch]]

2023年12月11日 (一) 05:08的版本

(base) ➜  nanoGPT git:(master) python data/shakespeare_char/prepare.py
length of dataset in characters: 1,115,394
all the unique characters:
 !$&',-.3:;?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
vocab size: 65
train has 1,003,854 tokens
val has 111,540 tokens
python train.py config/train_shakespeare_char.py

# Run it without GPU (mac air), pytorch nightly
# raise AssertionError("Torch not compiled with CUDA enabled")
python train.py config/train_shakespeare_char.py --device=cpu --compile=False --eval_iters=20 --log_interval=1 --block_size=64 --batch_size=12 --n_layer=4 --n_head=4 --n_embd=128 --max_iters=2000 --lr_decay_iters=2000 --dropout=0.0