leonarb commited on
Commit
9157a09
·
verified ·
1 Parent(s): 0e47094

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
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 = "/tmp/uploaded.pdf"
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)