fix: using tmp directory
Browse files- notebook_lm_kokoro.py +5 -4
notebook_lm_kokoro.py
CHANGED
@@ -292,15 +292,16 @@ def generate_podcast_script(
|
|
292 |
Set provider="openrouter" to use OpenRouter, otherwise uses OpenAI.
|
293 |
"""
|
294 |
pdf_basename = os.path.splitext(os.path.basename(pdf_path))[0]
|
295 |
-
folder = os.path.join(
|
296 |
os.makedirs(folder, exist_ok=True)
|
297 |
|
298 |
destination_pdf = os.path.join(folder, os.path.basename(pdf_path))
|
299 |
-
|
300 |
shutil.copy(pdf_path, destination_pdf)
|
301 |
print(f"Copied {pdf_path} to {destination_pdf}")
|
302 |
-
|
303 |
-
print(f"
|
|
|
304 |
|
305 |
transcript_path = os.path.join(folder, output_file)
|
306 |
# If transcript exists, load and return it without calling the API.
|
|
|
292 |
Set provider="openrouter" to use OpenRouter, otherwise uses OpenAI.
|
293 |
"""
|
294 |
pdf_basename = os.path.splitext(os.path.basename(pdf_path))[0]
|
295 |
+
folder = os.path.join("/tmp", pdf_basename)
|
296 |
os.makedirs(folder, exist_ok=True)
|
297 |
|
298 |
destination_pdf = os.path.join(folder, os.path.basename(pdf_path))
|
299 |
+
try:
|
300 |
shutil.copy(pdf_path, destination_pdf)
|
301 |
print(f"Copied {pdf_path} to {destination_pdf}")
|
302 |
+
except PermissionError:
|
303 |
+
print(f"[WARNING] Cannot copy PDF to {destination_pdf}, using original path.")
|
304 |
+
destination_pdf = pdf_path # fallback
|
305 |
|
306 |
transcript_path = os.path.join(folder, output_file)
|
307 |
# If transcript exists, load and return it without calling the API.
|