Question 1: Short answer
mediumAI-checkedTokenizationimport tiktoken
tokenizer = tiktoken.get_encoding("gpt2")
ids = tokenizer.encode("<|endoftext|>", allowed_special={"<|endoftext|>"})
print(ids, tokenizer.n_vocab)
The last line prints [ ] and then .
Fill in every blank (hints in the boxes). Enter moves to the next blank.