Explorar o código

A few cosmetic updates (#504)

Sebastian Raschka hai 10 meses
pai
achega
fd8d77a79d

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 30 - 31
appendix-D/01_main-chapter-code/appendix-D.ipynb


+ 5 - 3
ch07/01_main-chapter-code/ch07.ipynb

@@ -177,9 +177,11 @@
     "            text_data = response.read().decode(\"utf-8\")\n",
     "        with open(file_path, \"w\", encoding=\"utf-8\") as file:\n",
     "            file.write(text_data)\n",
-    "    else:\n",
-    "        with open(file_path, \"r\", encoding=\"utf-8\") as file:\n",
-    "            text_data = file.read()\n",
+    "    \n",
+    "    # The book originally contained this unnecessary \"else\" clause:\n",
+    "    #else:\n",
+    "    #    with open(file_path, \"r\", encoding=\"utf-8\") as file:\n",
+    "    #        text_data = file.read()\n",
     "\n",
     "    with open(file_path, \"r\", encoding=\"utf-8\") as file:\n",
     "        data = json.load(file)\n",

+ 0 - 3
ch07/01_main-chapter-code/gpt_instruction_finetuning.py

@@ -103,9 +103,6 @@ def download_and_load_file(file_path, url):
             text_data = response.read().decode("utf-8")
         with open(file_path, "w", encoding="utf-8") as file:
             file.write(text_data)
-    else:
-        with open(file_path, "r", encoding="utf-8") as file:
-            text_data = file.read()
 
     with open(file_path, "r") as file:
         data = json.load(file)

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio