Spaces:
Runtime error
Runtime error
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'))) | |