nanoGPT icon indicating copy to clipboard operation
nanoGPT copied to clipboard

Add stop token functionality

Open iokarkan opened this issue 2 years ago • 0 comments

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)

iokarkan avatar Apr 28 '23 16:04 iokarkan