Spaces:
Running
Running
import gradio as gr | |
import sys | |
import asyncio | |
sys.path.append('voice_chat') | |
from voice_chat import respond | |
def voice_chat(audio): | |
response_audio = asyncio.run(respond(audio)) | |
return response_audio | |
interface = gr.Interface( | |
fn=voice_chat, | |
inputs=gr.Audio(type="filepath"), | |
outputs=gr.Audio(), | |
title="Voice Chat with AI Assistant", | |
description="Speak into the microphone, and the AI will respond with voice.", | |
examples=None, | |
theme="default" | |
) | |
if __name__ == "__main__": | |
interface.launch(debug=True) |