BlueDice commited on
Commit
b5508e7
·
1 Parent(s): 405dcfb

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from handler import SweetCommander
2
+ import gradio as gr
3
+
4
+ controller = SweetCommander()
5
+
6
+ with gr.Blocks() as demo:
7
+ history = gr.State([])
8
+ with gr.Row() as row:
9
+ with gr.Column():
10
+ user_name = gr.Textbox(label="Name", placeholder="Enter your name")
11
+ user_input = gr.Textbox(label="Input", placeholder="Enter your message")
12
+ button = gr.Button("Enter")
13
+ with gr.Column():
14
+ output = gr.Textbox(label="Response")
15
+
16
+ def guess_letter(user_name, user_input):
17
+ response = controller(user_name, user_input)
18
+ return {
19
+ output: response
20
+ }
21
+ button.click(
22
+ guess_letter,
23
+ [user_name, user_input],
24
+ [output]
25
+ )
26
+ demo.launch()