|
import gradio as gr
|
|
from transformers import pipeline
|
|
|
|
def process_files():
|
|
return (gr.update(interactive=True,
|
|
elem_id='summary_button'),
|
|
gr.update(interactive = True, elem_id = 'summarization_method')
|
|
)
|
|
|
|
|
|
|
|
def get_summarization_method(option):
|
|
return option
|
|
|
|
|
|
|
|
|
|
def text_to_audio(text, model_name="facebook/fastspeech2-en-ljspeech"):
|
|
|
|
tts_pipeline = pipeline("text-to-speech", model=model_name)
|
|
|
|
|
|
audio = tts_pipeline(text)
|
|
|
|
|
|
audio_path = "output.wav"
|
|
with open(audio_path, "wb") as file:
|
|
file.write(audio["wav"])
|
|
|
|
return audio_path |