mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2025-10-28 16:30:07 +00:00
simplify
This commit is contained in:
parent
72f46297d9
commit
c21b9937e9
@ -181,29 +181,6 @@
|
|||||||
"tokenizer = tiktoken.get_encoding(\"gpt2\")"
|
"tokenizer = tiktoken.get_encoding(\"gpt2\")"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"cell_type": "markdown",
|
|
||||||
"id": "b319df48-8a14-4beb-966c-6b49e255c6ba",
|
|
||||||
"metadata": {},
|
|
||||||
"source": [
|
|
||||||
"In addition, we have to make sure that we use the `format_input_phi` function: "
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "markdown",
|
|
||||||
"id": "ed41ec0e-6a5a-44f1-bb3c-b7d0724cb4e1",
|
|
||||||
"metadata": {},
|
|
||||||
"source": [
|
|
||||||
"```python\n",
|
|
||||||
" train_losses, val_losses, tokens_seen = train_model_simple(\n",
|
|
||||||
" model, train_loader, val_loader, optimizer, device,\n",
|
|
||||||
" num_epochs=num_epochs, eval_freq=5, eval_iter=5,\n",
|
|
||||||
" start_context=format_input_phi(val_data[0]), # New: `Use format_input_phi` function\n",
|
|
||||||
" tokenizer=tokenizer\n",
|
|
||||||
" )\n",
|
|
||||||
"```"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "e0650926-c39f-4442-8116-cb7494416f28",
|
"id": "e0650926-c39f-4442-8116-cb7494416f28",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user