From 6030071e3fc4af3d79adf50c5adaee1be84a3958 Mon Sep 17 00:00:00 2001 From: rasbt Date: Mon, 5 Aug 2024 07:36:08 -0500 Subject: [PATCH] update model path --- .../dpo-from-scratch.ipynb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ch07/04_preference-tuning-with-dpo/dpo-from-scratch.ipynb b/ch07/04_preference-tuning-with-dpo/dpo-from-scratch.ipynb index edfd9dc..56426e1 100644 --- a/ch07/04_preference-tuning-with-dpo/dpo-from-scratch.ipynb +++ b/ch07/04_preference-tuning-with-dpo/dpo-from-scratch.ipynb @@ -1562,15 +1562,9 @@ " elif \"COLAB_GPU\" in os.environ or \"COLAB_TPU_ADDR\" in os.environ:\n", " from google.colab import 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", "\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", " print(\n", " f\"Could not find '{finetuned_model_path}'.\\n\"\n", @@ -3094,7 +3088,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.4" } }, "nbformat": 4,