Test code in pytorch 2.4 (#285)

* test code in pytorch 2.4

* update
This commit is contained in:
Sebastian Raschka
2024-07-24 21:53:41 -05:00
committed by GitHub
parent 6cbe6520a2
commit 08040f024c
17 changed files with 509 additions and 377 deletions

File diff suppressed because one or more lines are too long

View File

@@ -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,