update model path

This commit is contained in:
rasbt 2024-08-05 07:36:08 -05:00
parent 22681878a8
commit 6030071e3f

View File

@ -1562,15 +1562,9 @@
" elif \"COLAB_GPU\" in os.environ or \"COLAB_TPU_ADDR\" in os.environ:\n", " elif \"COLAB_GPU\" in os.environ or \"COLAB_TPU_ADDR\" in os.environ:\n",
" from google.colab import drive\n", " from google.colab import drive\n",
" drive.mount(\"/content/drive\")\n", " drive.mount(\"/content/drive\")\n",
" google_drive_path = \"/content/drive/My Drive/Books/LLMs-From-Scratch/ch07/gpt2-medium355M-sft__colab.pth\" # Readers need to adjust this path\n", " google_drive_path = \"/content/drive/My Drive/Books/LLMs-From-Scratch/ch07/colab/gpt2-medium355M-sft.pth\" # Readers need to adjust this path\n",
" shutil.copy(google_drive_path, \".\")\n", " shutil.copy(google_drive_path, \".\")\n",
"\n", "\n",
" # Rename the file because my finetuned model in colab has the \"__colab.pth\" suffix\n",
" filename = os.path.basename(google_drive_path)\n",
" if filename.endswith(\"__colab.pth\"):\n",
" new_filename = filename.replace(\"__colab.pth\", \".pth\")\n",
" os.rename(filename, new_filename)\n",
"\n",
" else:\n", " else:\n",
" print(\n", " print(\n",
" f\"Could not find '{finetuned_model_path}'.\\n\"\n", " f\"Could not find '{finetuned_model_path}'.\\n\"\n",
@ -3094,7 +3088,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.11.4"
} }
}, },
"nbformat": 4, "nbformat": 4,