Kevin676 commited on
Commit
621ca95
·
1 Parent(s): cd6874a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -7
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
- demo = gr.Interface(
 
 
 
 
 
 
 
228
  fn=greet,
229
- inputs=[gr.inputs.Textbox(label='请输入您的openai.api_key'), gr.Audio(source="microphone", label='在这里进行对话', type="filepath"), gr.Audio(type="filepath", source="upload",label='Please upload a voice to clone (max. 30mb)'), gr.Audio(source="microphone", type="filepath", streaming=True)],
230
- outputs="audio",
231
- title="Bilal's Voice Cloning Tool"
232
- )
233
- demo.launch(show_error = True)
 
 
 
 
 
 
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)