Spaces:
Sleeping
Sleeping
kahennefer
commited on
Commit
•
65bdf91
1
Parent(s):
b2e2224
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,13 @@
|
|
1 |
|
2 |
#libraries
|
3 |
-
|
4 |
from PyPDF2 import PdfReader
|
5 |
-
import
|
|
|
6 |
from bark import SAMPLE_RATE, generate_audio, preload_models
|
7 |
from scipy.io.wavfile import write as write_wav
|
8 |
from IPython.display import Audio
|
9 |
-
import
|
10 |
|
11 |
|
12 |
def summarize_abstract_from_pdf(pdf_file_path):
|
@@ -96,7 +97,7 @@ examples = [
|
|
96 |
# Create the Gradio app
|
97 |
demo = gr.Interface(
|
98 |
fn=generate_audio,
|
99 |
-
inputs="
|
100 |
outputs="audio",
|
101 |
title=app_name,
|
102 |
description=app_description,
|
|
|
1 |
|
2 |
#libraries
|
3 |
+
import gradio as gr
|
4 |
from PyPDF2 import PdfReader
|
5 |
+
from tempfile import NamedTemporaryFile
|
6 |
+
from transformers import pipeline
|
7 |
from bark import SAMPLE_RATE, generate_audio, preload_models
|
8 |
from scipy.io.wavfile import write as write_wav
|
9 |
from IPython.display import Audio
|
10 |
+
import torch
|
11 |
|
12 |
|
13 |
def summarize_abstract_from_pdf(pdf_file_path):
|
|
|
97 |
# Create the Gradio app
|
98 |
demo = gr.Interface(
|
99 |
fn=generate_audio,
|
100 |
+
inputs="file",
|
101 |
outputs="audio",
|
102 |
title=app_name,
|
103 |
description=app_description,
|