Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,12 +36,12 @@ with gr.Blocks() as demo:
|
|
| 36 |
gr.Markdown("# <center> OpenAI Text-To-Speech API with Gradio </center>")
|
| 37 |
#gr.HTML("You can also access the Streaming demo for OpenAI TTS by clicking this <a href='https://huggingface.co/spaces/ysharma/OpenAI_TTS_Streaming'>Gradio demo link</a>")
|
| 38 |
with gr.Row(variant='panel'):
|
| 39 |
-
api_key = gr.Textbox(type='password', label='OpenAI API Key', placeholder='
|
| 40 |
model = gr.Dropdown(choices=['tts-1','tts-1-hd'], label='Model', value='tts-1')
|
| 41 |
-
voice = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='
|
| 42 |
|
| 43 |
-
text = gr.Textbox(label="
|
| 44 |
-
btn = gr.Button("
|
| 45 |
output_audio = gr.Audio(label="Speech Output")
|
| 46 |
|
| 47 |
text.submit(fn=tts, inputs=[text, model, voice, api_key], outputs=output_audio, api_name="tts_enter_key", concurrency_limit=None)
|
|
|
|
| 36 |
gr.Markdown("# <center> OpenAI Text-To-Speech API with Gradio </center>")
|
| 37 |
#gr.HTML("You can also access the Streaming demo for OpenAI TTS by clicking this <a href='https://huggingface.co/spaces/ysharma/OpenAI_TTS_Streaming'>Gradio demo link</a>")
|
| 38 |
with gr.Row(variant='panel'):
|
| 39 |
+
api_key = gr.Textbox(type='password', label='OpenAI API Key', placeholder='输入你的 OpenaAI API key')
|
| 40 |
model = gr.Dropdown(choices=['tts-1','tts-1-hd'], label='Model', value='tts-1')
|
| 41 |
+
voice = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='选择声音', value='alloy')
|
| 42 |
|
| 43 |
+
text = gr.Textbox(label="输入文本,支持多语言以及混合语言", placeholder="Enter your text and then click on the 'Text-To-Speech' button, or simply press the Enter key.", lines=5)
|
| 44 |
+
btn = gr.Button("合成语音")
|
| 45 |
output_audio = gr.Audio(label="Speech Output")
|
| 46 |
|
| 47 |
text.submit(fn=tts, inputs=[text, model, voice, api_key], outputs=output_audio, api_name="tts_enter_key", concurrency_limit=None)
|