Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,9 +90,7 @@ def create_epub_from_text(text, output_path, title, author, language, cover_imag
|
|
| 90 |
|
| 91 |
def convert_pdf_to_epub(pdf_file, title, author, language):
|
| 92 |
# Save the uploaded file to a temporary path
|
| 93 |
-
tmp_pdf_path =
|
| 94 |
-
with open(tmp_pdf_path, "wb") as f:
|
| 95 |
-
f.write(pdf_file.read()) # This ensures the file isn't empty
|
| 96 |
|
| 97 |
# Now it's safe to read it
|
| 98 |
reader = PdfReader(tmp_pdf_path)
|
|
|
|
| 90 |
|
| 91 |
def convert_pdf_to_epub(pdf_file, title, author, language):
|
| 92 |
# Save the uploaded file to a temporary path
|
| 93 |
+
tmp_pdf_path = pdf_file.name # Use the actual temp file path from Gradio
|
|
|
|
|
|
|
| 94 |
|
| 95 |
# Now it's safe to read it
|
| 96 |
reader = PdfReader(tmp_pdf_path)
|