Spaces:
Paused
Paused
FranklinWillemen
commited on
Commit
•
b4103dd
1
Parent(s):
8cdc72a
initial branch commit
Browse files- gradio-ui.py +21 -0
gradio-ui.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import discourse as d
|
3 |
+
|
4 |
+
# set a custom theme
|
5 |
+
theme = gr.themes.Default().set(
|
6 |
+
body_background_fill="#000000",
|
7 |
+
)
|
8 |
+
|
9 |
+
with gr.Blocks(theme=theme) as ui:
|
10 |
+
# advisor image input and microphone input
|
11 |
+
# advisor = gr.Image(value=config.TARS_LOGO).style(width=config.LOGO_IMAGE_WIDTH, height=config.LOGO_IMAGE_HEIGHT)
|
12 |
+
message = gr.Audio(source="microphone", type="filepath")
|
13 |
+
response = gr.Audio()
|
14 |
+
|
15 |
+
# text transcript output and audio
|
16 |
+
# text_output = gr.Textbox(label="Transcript")
|
17 |
+
|
18 |
+
btn = gr.Button("Run")
|
19 |
+
btn.click(fn=d.respond, inputs=message, outputs=[response])
|
20 |
+
|
21 |
+
ui.launch()
|