Update app.py
Browse files
app.py
CHANGED
@@ -222,12 +222,24 @@ def greet(Text2, audio, Voicetoclone,VoiceMicrophone):
|
|
222 |
|
223 |
enhanced = enhance_model.enhance_batch(noisy, lengths=torch.tensor([1.]))
|
224 |
torchaudio.save("enhanced.wav", enhanced.cpu(), 16000)
|
225 |
-
return "enhanced.wav"
|
226 |
|
227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
fn=greet,
|
229 |
-
inputs=[
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
enhanced = enhance_model.enhance_batch(noisy, lengths=torch.tensor([1.]))
|
224 |
torchaudio.save("enhanced.wav", enhanced.cpu(), 16000)
|
225 |
+
return [result.text, chat_response, "enhanced.wav"]
|
226 |
|
227 |
+
output_1 = gr.Textbox(label="Speech to Text")
|
228 |
+
output_2 = gr.Textbox(label="ChatGPT Output")
|
229 |
+
output_3 = gr.Audio(label="Audio with Custom Voice")
|
230 |
+
|
231 |
+
gr.Interface(
|
232 |
+
title = '🥳💬💕 - TalktoAI,随时随地,谈天说地!',
|
233 |
+
theme="huggingface",
|
234 |
+
description = "🤖 - 让有人文关怀的AI造福每一个人!AI向善,文明璀璨!TalktoAI - Enable the future!",
|
235 |
fn=greet,
|
236 |
+
inputs=[
|
237 |
+
gr.Textbox(lines=1, label = "请填写您的OpenAI-API-key"),
|
238 |
+
gr.Audio(source="microphone", label='在这里进行对话', type="filepath"),
|
239 |
+
gr.Audio(type="filepath", source="upload",label='请上传您喜欢的声音(wav文件)').
|
240 |
+
gr.Audio(source="microphone", type="filepath", "请用麦克风上传您喜欢的声音,与wav文件二选一即可"),
|
241 |
+
],
|
242 |
+
outputs=[
|
243 |
+
output_1, output_2, output_3
|
244 |
+
],
|
245 |
+
).launch(show_error = True)
|