nanoGPT
nanoGPT copied to clipboard
Add stop token functionality
Small modification to generate function to return upon detecting an encoded stop string's token(s), along with a new global stop variable.
Checked with python sample.py --init_from=gpt2 --start='This is ' --stop=. --num_samples=4 --max_new_tokens=100 --device='cuda' --dtype=float16
(closed my erroneous previous pull request of the same nature, it can be deleted)