Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
whisper_to_gpt = gr.Blocks.load(name="spaces/fffiloni/whisper-to-chatGPT")
|
4 |
+
tts = gr.Interface.load(name="spaces/StevenLimcorn/fastspeech2-TTS")
|
5 |
+
|
6 |
+
def infer(audio):
|
7 |
+
gpt_response = whisper_to_gpt(audio, "translate", fn_index=1)
|
8 |
+
audio_response = tts(gpt_response, "Fastspeech2 + Melgan", fn_index=0)
|
9 |
+
return audio_response
|
10 |
+
|
11 |
+
inputs = gr.Audio(source="microphone",type="filepath")
|
12 |
+
outputs = gr.Audio()
|
13 |
+
|
14 |
+
demo = gr.Interface(fn=infer, inputs=inputs, outputs=outputs)
|
15 |
+
demo.launch()
|
16 |
+
|