mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
committed by
GitHub
parent
6cbe6520a2
commit
08040f024c
File diff suppressed because one or more lines are too long
@@ -47,7 +47,7 @@
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"tiktoken version: 0.7.0\n",
|
||||
"torch version: 2.3.1\n"
|
||||
"torch version: 2.4.0\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -120,7 +120,11 @@
|
||||
"source": [
|
||||
"import torch\n",
|
||||
"\n",
|
||||
"model.load_state_dict(torch.load(\"gpt2-medium355M-sft.pth\", map_location=torch.device(\"cpu\")))\n",
|
||||
"model.load_state_dict(torch.load(\n",
|
||||
" \"gpt2-medium355M-sft.pth\",\n",
|
||||
" map_location=torch.device(\"cpu\"),\n",
|
||||
" weights_only=True\n",
|
||||
"))\n",
|
||||
"model.eval();"
|
||||
]
|
||||
},
|
||||
@@ -207,7 +211,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.12.2"
|
||||
"version": "3.11.4"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Reference in New Issue
Block a user