Spaces:
Runtime error
Runtime error
File size: 648 Bytes
a95b578 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import os
from dotenv import load_dotenv
load_dotenv()
import model
# Get TTS model
if not os.path.exists('tts_model'):
model.download_model()
import audio
import gradio as gr
def update_widget():
return gr.Button(value='Creating audio...', interactive=False)
with gr.Blocks() as app:
text = gr.Textbox(label="Text")
button = gr.Button(value='Create audio')
audio_file = gr.Audio(visible=False)
button.click(
update_widget, None, button
).then(
audio.get_audio, text, audio_file
)
app.queue()
app.launch(debug=True, auth=(os.environ.get('SPACE_USERNAME'), os.environ.get('SPACE_PASSWORD')))
|