瀏覽代碼

use utf-8 encoding in json

rasbt 1 年之前
父節點
當前提交
46fcde15d8
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      ch07/01_main-chapter-code/ch07.ipynb

+ 7 - 7
ch07/01_main-chapter-code/ch07.ipynb

@@ -48,10 +48,10 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "matplotlib version: 3.8.4\n",
-      "tiktoken version: 0.6.0\n",
-      "torch version: 2.2.2\n",
-      "tqdm version: 4.66.2\n",
+      "matplotlib version: 3.9.0\n",
+      "tiktoken version: 0.7.0\n",
+      "torch version: 2.3.1\n",
+      "tqdm version: 4.66.4\n",
       "tensorflow version: 2.16.1\n"
      ]
     }
@@ -146,7 +146,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 3,
+   "execution_count": 2,
    "id": "0G3axLw6kY1N",
    "metadata": {
     "colab": {
@@ -181,7 +181,7 @@
     "        with open(file_path, \"r\", encoding=\"utf-8\") as file:\n",
     "            text_data = file.read()\n",
     "\n",
-    "    with open(file_path, \"r\") as file:\n",
+    "    with open(file_path, \"r\", encoding=\"utf-8\") as file:\n",
     "        data = json.load(file)\n",
     "\n",
     "    return data\n",
@@ -209,7 +209,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
+   "execution_count": 3,
    "id": "-LiuBMsHkzQV",
    "metadata": {
     "colab": {