Quellcode durchsuchen

Address PR Comments

Sanyam Bhutani vor 5 Monaten
Ursprung
Commit
95db0fe42d

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

@@ -59,7 +59,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "pdf_path = './2402.13116v3.pdf'\n",
+    "pdf_path = './resources/2402.13116v3.pdf'\n",
     "DEFAULT_MODEL = \"meta-llama/Llama-3.2-1B-Instruct\""
    ]
   },
@@ -469,7 +469,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "INPUT_FILE = \"./extracted_text.txt\"  # Replace with your file path\n",
+    "INPUT_FILE = \"./resources/extracted_text.txt\"  # Replace with your file path\n",
     "CHUNK_SIZE = 1000  # Adjust chunk size if needed\n",
     "\n",
     "chunks = create_word_bounded_chunks(text, CHUNK_SIZE)\n",

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

@@ -162,7 +162,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "INPUT_PROMPT = read_file_to_string('./clean_extracted_text.txt')"
+    "INPUT_PROMPT = read_file_to_string('./resources/clean_extracted_text.txt')"
    ]
   },
   {
@@ -298,7 +298,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "with open('data.pkl', 'wb') as file:\n",
+    "with open('./resources/data.pkl', 'wb') as file:\n",
     "    pickle.dump(save_string_pkl, file)"
    ]
   },

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

@@ -146,7 +146,7 @@
    "source": [
     "import pickle\n",
     "\n",
-    "with open('data.pkl', 'rb') as file:\n",
+    "with open('./resources/data.pkl', 'rb') as file:\n",
     "    INPUT_PROMPT = pickle.load(file)"
    ]
   },
@@ -191,7 +191,7 @@
     "    \"text-generation\",\n",
     "    model=MODEL,\n",
     "    model_kwargs={\"torch_dtype\": torch.bfloat16},\n",
-    "    device_map=\"cuda:7\",\n",
+    "    device_map=\"auto\",\n",
     ")\n",
     "\n",
     "messages = [\n",
@@ -249,7 +249,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "with open('podcast_ready_data.pkl', 'wb') as file:\n",
+    "with open('./resources/podcast_ready_data.pkl', 'wb') as file:\n",
     "    pickle.dump(save_string_pkl, file)"
    ]
   },

+ 5 - 3
recipes/quickstart/NotebookLlama/Step-4-TTS-Workflow.ipynb

@@ -119,7 +119,9 @@
    "source": [
     "Generally in life, you set your device to \"cuda\" and are happy. \n",
     "\n",
-    "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:"
+    "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",
+    "\n",
+    "Jokes aside please set `device = \"cuda\"` below if you're using a single GPU node."
    ]
   },
   {
@@ -289,7 +291,7 @@
    "source": [
     "import pickle\n",
     "\n",
-    "with open('./podcast_ready_data.pkl', 'rb') as file:\n",
+    "with open('./resources/podcast_ready_data.pkl', 'rb') as file:\n",
     "    PODCAST_TEXT = pickle.load(file)"
    ]
   },
@@ -631,7 +633,7 @@
     }
    ],
    "source": [
-    "final_audio.export(\"_podcast.mp3\", \n",
+    "final_audio.export(\"./resources/_podcast.mp3\", \n",
     "                  format=\"mp3\", \n",
     "                  bitrate=\"192k\",\n",
     "                  parameters=[\"-q:a\", \"0\"])"

+ 15 - 0
recipes/quickstart/NotebookLlama/requirements.txt

@@ -0,0 +1,15 @@
+# Core dependencies
+PyPDF2>=3.0.0
+torch>=2.0.0
+transformers>=4.46.0
+accelerate>=0.27.0
+rich>=13.0.0
+ipywidgets>=8.0.0
+tqdm>=4.66.0
+
+# Optional but recommended
+jupyter>=1.0.0
+ipykernel>=6.0.0
+
+# Warning handling
+warnings>=0.1.0