MusIre commited on
Commit
5450db8
1 Parent(s): 303b6e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -7,7 +7,14 @@ from transformers import pipeline
7
  from bark import SAMPLE_RATE, generate_audio, preload_models
8
  import gradio as gr
9
 
10
- def summarize_and_convert_to_audio(pdf_path, abstract_page):
 
 
 
 
 
 
 
11
  with open(pdf_path, 'rb') as file:
12
  pdf_reader = PyPDF2.PdfReader(file)
13
 
 
7
  from bark import SAMPLE_RATE, generate_audio, preload_models
8
  import gradio as gr
9
 
10
+ def summarize_and_convert_to_audio(pdf_file, abstract_page):
11
+ # Save the uploaded file
12
+ pdf_path = "/tmp/uploaded_file.pdf"
13
+ pdf_file.save(pdf_path)
14
+
15
+ # Convert abstract_page to integer
16
+ abstract_page = int(abstract_page)
17
+
18
  with open(pdf_path, 'rb') as file:
19
  pdf_reader = PyPDF2.PdfReader(file)
20