mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
<|endoftext|> token in dataset v1
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
" self.target_ids = []\n",
|
||||
"\n",
|
||||
" # Tokenize the entire text\n",
|
||||
" token_ids = tokenizer.encode(txt)\n",
|
||||
" token_ids = tokenizer.encode(txt, allowed_special={'<|endoftext|>'})\n",
|
||||
"\n",
|
||||
" # Use a sliding window to chunk the book into overlapping sequences of max_length\n",
|
||||
" for i in range(0, len(token_ids) - max_length, stride):\n",
|
||||
|
||||
Reference in New Issue
Block a user