Skip to content

Commit 95db0fe

Browse files
committed
Address PR Comments
1 parent 572f44d commit 95db0fe

File tree

5 files changed

+27
-10
lines changed

5 files changed

+27
-10
lines changed

recipes/quickstart/NotebookLlama/Step-1 PDF-Pre-Processing-Logic.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"metadata": {},
6060
"outputs": [],
6161
"source": [
62-
"pdf_path = './2402.13116v3.pdf'\n",
62+
"pdf_path = './resources/2402.13116v3.pdf'\n",
6363
"DEFAULT_MODEL = \"meta-llama/Llama-3.2-1B-Instruct\""
6464
]
6565
},
@@ -469,7 +469,7 @@
469469
"metadata": {},
470470
"outputs": [],
471471
"source": [
472-
"INPUT_FILE = \"./extracted_text.txt\" # Replace with your file path\n",
472+
"INPUT_FILE = \"./resources/extracted_text.txt\" # Replace with your file path\n",
473473
"CHUNK_SIZE = 1000 # Adjust chunk size if needed\n",
474474
"\n",
475475
"chunks = create_word_bounded_chunks(text, CHUNK_SIZE)\n",

recipes/quickstart/NotebookLlama/Step-2-Transcript-Writer.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
"metadata": {},
163163
"outputs": [],
164164
"source": [
165-
"INPUT_PROMPT = read_file_to_string('./clean_extracted_text.txt')"
165+
"INPUT_PROMPT = read_file_to_string('./resources/clean_extracted_text.txt')"
166166
]
167167
},
168168
{
@@ -298,7 +298,7 @@
298298
"metadata": {},
299299
"outputs": [],
300300
"source": [
301-
"with open('data.pkl', 'wb') as file:\n",
301+
"with open('./resources/data.pkl', 'wb') as file:\n",
302302
" pickle.dump(save_string_pkl, file)"
303303
]
304304
},

recipes/quickstart/NotebookLlama/Step-3-Re-Writer.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
"source": [
147147
"import pickle\n",
148148
"\n",
149-
"with open('data.pkl', 'rb') as file:\n",
149+
"with open('./resources/data.pkl', 'rb') as file:\n",
150150
" INPUT_PROMPT = pickle.load(file)"
151151
]
152152
},
@@ -191,7 +191,7 @@
191191
" \"text-generation\",\n",
192192
" model=MODEL,\n",
193193
" model_kwargs={\"torch_dtype\": torch.bfloat16},\n",
194-
" device_map=\"cuda:7\",\n",
194+
" device_map=\"auto\",\n",
195195
")\n",
196196
"\n",
197197
"messages = [\n",
@@ -249,7 +249,7 @@
249249
"metadata": {},
250250
"outputs": [],
251251
"source": [
252-
"with open('podcast_ready_data.pkl', 'wb') as file:\n",
252+
"with open('./resources/podcast_ready_data.pkl', 'wb') as file:\n",
253253
" pickle.dump(save_string_pkl, file)"
254254
]
255255
},

recipes/quickstart/NotebookLlama/Step-4-TTS-Workflow.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@
119119
"source": [
120120
"Generally in life, you set your device to \"cuda\" and are happy. \n",
121121
"\n",
122-
"However, sometimes you want to compensate for things and set it to `cuda:7` to tell the system but even more-so the world that you have 8 GPUS:"
122+
"However, sometimes you want to compensate for things and set it to `cuda:7` to tell the system but even more-so the world that you have 8 GPUS.\n",
123+
"\n",
124+
"Jokes aside please set `device = \"cuda\"` below if you're using a single GPU node."
123125
]
124126
},
125127
{
@@ -289,7 +291,7 @@
289291
"source": [
290292
"import pickle\n",
291293
"\n",
292-
"with open('./podcast_ready_data.pkl', 'rb') as file:\n",
294+
"with open('./resources/podcast_ready_data.pkl', 'rb') as file:\n",
293295
" PODCAST_TEXT = pickle.load(file)"
294296
]
295297
},
@@ -631,7 +633,7 @@
631633
}
632634
],
633635
"source": [
634-
"final_audio.export(\"_podcast.mp3\", \n",
636+
"final_audio.export(\"./resources/_podcast.mp3\", \n",
635637
" format=\"mp3\", \n",
636638
" bitrate=\"192k\",\n",
637639
" parameters=[\"-q:a\", \"0\"])"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Core dependencies
2+
PyPDF2>=3.0.0
3+
torch>=2.0.0
4+
transformers>=4.46.0
5+
accelerate>=0.27.0
6+
rich>=13.0.0
7+
ipywidgets>=8.0.0
8+
tqdm>=4.66.0
9+
10+
# Optional but recommended
11+
jupyter>=1.0.0
12+
ipykernel>=6.0.0
13+
14+
# Warning handling
15+
warnings>=0.1.0

0 commit comments

Comments
 (0)