mkw18 commited on
Commit
43a01f6
1 Parent(s): 650997a
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -85,14 +85,21 @@ def CheckTerm(chatbot, key):
85
 
86
  with gr.Blocks() as demo:
87
  gr.HTML("""<h1 align="center">Generative Agents测试平台</h1>""")
88
- user_key = gr.Textbox(label='Key', placeholder="Input your key...", lines=1, max_lines=1).style(
89
  container=False)
90
  chatbot = gr.Chatbot([])
91
 
92
  with gr.Row():
93
- test_btn = gr.Button('测试')
 
 
 
 
 
94
 
95
  user_key.submit(CheckTerm, [chatbot, user_key], [chatbot])
96
- test_btn.click(test, [chatbot], [chatbot])
 
 
97
 
98
  demo.queue().launch()
 
85
 
86
  with gr.Blocks() as demo:
87
  gr.HTML("""<h1 align="center">Generative Agents测试平台</h1>""")
88
+ user_key = gr.Textbox(label='Key', placeholder="Input your key, press enter to apply", lines=1, max_lines=1).style(
89
  container=False)
90
  chatbot = gr.Chatbot([])
91
 
92
  with gr.Row():
93
+ with gr.Column(scale=1):
94
+ trueBtn = gr.Button('是')
95
+ with gr.Column(scale=1):
96
+ falseBtn = gr.Button('否')
97
+ with gr.Column(scale=1):
98
+ termBtn = gr.Button('得到正确结果')
99
 
100
  user_key.submit(CheckTerm, [chatbot, user_key], [chatbot])
101
+ trueBtn.click(CheckTrue, [chatbot, user_key], [chatbot])
102
+ falseBtn.click(CheckFalse, [chatbot, user_key], [chatbot])
103
+ termBtn.click(CheckTerm, [chatbot, user_key], [chatbot])
104
 
105
  demo.queue().launch()