|
|
|
|
|
import gradio as gr |
|
|
from pipeline import voice_to_voice |
|
|
|
|
|
with gr.Blocks(title="Voice to Voice AI Assistant") as demo: |
|
|
gr.Markdown("## ποΈ Voice to Voice AI Assistant") |
|
|
gr.Markdown("Speak β AI thinks β AI speaks back") |
|
|
|
|
|
audio_input = gr.Audio( |
|
|
sources=["microphone"], |
|
|
type="filepath", |
|
|
label="Speak Here" |
|
|
) |
|
|
|
|
|
audio_output = gr.Audio( |
|
|
type="filepath", |
|
|
label="AI Voice Response" |
|
|
) |
|
|
|
|
|
text_output = gr.Textbox(label="AI Text Response") |
|
|
|
|
|
btn = gr.Button("Run") |
|
|
|
|
|
btn.click( |
|
|
fn=voice_to_voice, |
|
|
inputs=audio_input, |
|
|
outputs=[audio_output, text_output], |
|
|
) |
|
|
|
|
|
demo.launch() |