Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|