mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2025-06-26 23:50:03 +00:00
A few cosmetic updates (#504)
This commit is contained in:
parent
0911e71497
commit
fd8d77a79d
File diff suppressed because one or more lines are too long
@ -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",
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user