Spaces:
Paused
Paused
zxsipola123456
commited on
Commit
•
f1f53e4
1
Parent(s):
3572db4
Update app.py
Browse files
app.py
CHANGED
@@ -90,7 +90,9 @@ def tts(text, model, voice, api_key):
|
|
90 |
with tempfile.NamedTemporaryFile(suffix=".mp3", delete=False) as temp_file:
|
91 |
temp_file.write(response.content)
|
92 |
|
93 |
-
|
|
|
|
|
94 |
|
95 |
def validate_api_key(api_key):
|
96 |
try:
|
@@ -181,7 +183,7 @@ with app:
|
|
181 |
btn_vc.click(voice_change, [output_audio, inp_vc], out_vc)
|
182 |
with gr.Tab("官方key-TTS文本生语音"):
|
183 |
with gr.Row(variant='panel'):
|
184 |
-
api_key = gr.Textbox(type='password', label='API Key', placeholder='请在此填写您在https://buy.sipola.cn
|
185 |
model = gr.Dropdown(choices=['tts-1','tts-1-hd'], label='请选择模型(tts-1推理更快,tts-1-hd音质更好)', value='tts-1')
|
186 |
voice = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='请选择一个说话人', value='alloy')
|
187 |
with gr.Row():
|
|
|
90 |
with tempfile.NamedTemporaryFile(suffix=".mp3", delete=False) as temp_file:
|
91 |
temp_file.write(response.content)
|
92 |
|
93 |
+
temp_file_path = temp_file.name
|
94 |
+
|
95 |
+
return temp_file_path
|
96 |
|
97 |
def validate_api_key(api_key):
|
98 |
try:
|
|
|
183 |
btn_vc.click(voice_change, [output_audio, inp_vc], out_vc)
|
184 |
with gr.Tab("官方key-TTS文本生语音"):
|
185 |
with gr.Row(variant='panel'):
|
186 |
+
api_key = gr.Textbox(type='password', label='API Key', placeholder='请在此填写您在https://buy.sipola.cn 获取的官方API Key')
|
187 |
model = gr.Dropdown(choices=['tts-1','tts-1-hd'], label='请选择模型(tts-1推理更快,tts-1-hd音质更好)', value='tts-1')
|
188 |
voice = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='请选择一个说话人', value='alloy')
|
189 |
with gr.Row():
|