Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,13 +12,10 @@ Original file is located at
|
|
| 12 |
# Here are the imports
|
| 13 |
import PyPDF2
|
| 14 |
import re
|
| 15 |
-
#import numpy as np
|
| 16 |
import transformers
|
| 17 |
import scipy
|
| 18 |
from transformers import pipeline
|
| 19 |
from bark import SAMPLE_RATE, generate_audio, preload_models
|
| 20 |
-
#from scipy.io.wavfile import write as write_wav
|
| 21 |
-
#from IPython.display import Audio
|
| 22 |
import gradio as gr
|
| 23 |
import os
|
| 24 |
|
|
@@ -76,15 +73,11 @@ def abstract_to_audio(insert_pdf):
|
|
| 76 |
audio_array = generate_audio(tss_prompt)
|
| 77 |
return (SAMPLE_RATE, audio_array)
|
| 78 |
|
| 79 |
-
#tss_pipeline = pipeline("text-to-speech", "suno/bark")
|
| 80 |
-
#speech = tss_pipeline(tss_prompt)
|
| 81 |
-
#return (speech["sampling_rate"], speech["audio"])
|
| 82 |
-
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
my_app = gr.Interface(fn=abstract_to_audio, inputs='file', outputs='audio', title="PDF Abstract Summarizer",
|
| 89 |
-
description="Extracts abstracts from PDFs and generates audio summaries. This app only accepts PDFs with abstracts.", examples=[os.path.join(os.path.dirname(__file__), "Hidden_Technical_Debt_in_MLSystems.pdf")],cache_examples=True)
|
| 90 |
my_app.launch()
|
|
|
|
| 12 |
# Here are the imports
|
| 13 |
import PyPDF2
|
| 14 |
import re
|
|
|
|
| 15 |
import transformers
|
| 16 |
import scipy
|
| 17 |
from transformers import pipeline
|
| 18 |
from bark import SAMPLE_RATE, generate_audio, preload_models
|
|
|
|
|
|
|
| 19 |
import gradio as gr
|
| 20 |
import os
|
| 21 |
|
|
|
|
| 73 |
audio_array = generate_audio(tss_prompt)
|
| 74 |
return (SAMPLE_RATE, audio_array)
|
| 75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
my_app = gr.Interface(fn=abstract_to_audio, inputs='file', outputs='audio', title="PDF Abstract Summarizer",
|
| 82 |
+
description="Extracts abstracts from PDFs and generates audio summaries. This app only accepts PDFs with abstracts.", examples=[os.path.join(os.path.dirname(__file__), "Hidden_Technical_Debt_in_MLSystems.pdf"),os.path.join(os.path.dirname(__file__), "Productivity_Effects_of_GenAI.pdf")],cache_examples=True)
|
| 83 |
my_app.launch()
|