Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import sys
|
3 |
+
sys.path.append('/voice_chat')
|
4 |
+
from voice_chat import respond
|
5 |
+
|
6 |
+
def voice_chat(audio):
|
7 |
+
response_audio = asyncio.run(respond(audio))
|
8 |
+
return response_audio
|
9 |
+
interface = gr.Interface(
|
10 |
+
fn=voice_chat,
|
11 |
+
inputs=gr.Audio(type="filepath"),
|
12 |
+
outputs=gr.Audio(),
|
13 |
+
title="Voice Chat with AI Assistant",
|
14 |
+
description="Speak into the microphone, and the AI will respond with voice.",
|
15 |
+
examples=None,
|
16 |
+
theme="default"
|
17 |
+
)
|
18 |
+
|
19 |
+
if __name__ == "__main__":
|
20 |
+
interface.launch(debug=True)
|