Spaces:
Paused
Paused
File size: 720 Bytes
b4103dd b51ffc6 f43a6b0 b51ffc6 f43a6b0 b51ffc6 b4103dd b51ffc6 22ba21a b4103dd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import gradio as gr
import discourse as d
# set a custom theme
theme = gr.themes.Default().set(
body_background_fill="#000000",
)
with gr.Blocks(theme=theme) as ui:
with gr.Row():
with gr.Column(scale=1):
message = gr.Audio(source="microphone", type="filepath")
with gr.Row():
btn1 = gr.Button("Respond")
with gr.Row():
with gr.Column(scale=1):
audio_response = gr.Audio()
with gr.Row():
text_response = gr.Textbox(label="Transcript", max_lines=10)
with gr.Row():
btn2 = gr.Button("Save Conversation")
btn1.click(fn=d.respond, inputs=message, outputs=[audio_response, text_response])
btn2.click(fn=d.memory)
ui.launch()
|