mkw18 commited on
Commit
8ced746
1 Parent(s): 0234ead
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -65,19 +65,19 @@ def SubmitKey(chatbot, key):
65
  def CheckTrue(chatbot, key):
66
  data = {'AgentCheck': True, 'key': key}
67
  response=requests.post(os.environ.get("URL"), data=json.dumps(data, ensure_ascii=False).encode('utf-8'))
68
- chatbot.append((parse_text(""), parse_text(str(response.content, encoding="utf-8"))))
69
  return chatbot
70
 
71
  def CheckFalse(chatbot, key):
72
  data = {'AgentCheck': False, 'key': key}
73
  response=requests.post(os.environ.get("URL"), data=json.dumps(data, ensure_ascii=False).encode('utf-8'))
74
- chatbot.append((parse_text(""), parse_text(str(response.content, encoding="utf-8"))))
75
  return chatbot
76
 
77
  def CheckIrrelevant(chatbot, key):
78
  data = {'AgentCheck': 'Irrelevant', 'key': key}
79
  response=requests.post(os.environ.get("URL"), data=json.dumps(data, ensure_ascii=False).encode('utf-8'))
80
- chatbot.append((parse_text("无关"), parse_text(str(response.content, encoding="utf-8"))))
81
  return chatbot
82
 
83
  def CheckTerm(chatbot, key):
@@ -93,14 +93,14 @@ def CheckTerm(chatbot, key):
93
 
94
  with gr.Blocks() as demo:
95
  gr.HTML("""<h1 align="center">Generative Agents测试平台</h1>""")
96
- user_key = gr.Textbox(label='Key', placeholder="Input your key, press enter to apply", lines=1, max_lines=1).style(
97
  container=False)
98
  with gr.Row():
99
  with gr.Column(scale=1):
100
- story = gr.Textbox(label='Story', lines=3, max_lines=3).style(
101
  container=False)
102
  with gr.Column(scale=1):
103
- answer = gr.Textbox(label='Answer', lines=3, max_lines=3).style(
104
  container=False)
105
  chatbot = gr.Chatbot([])
106
 
 
65
  def CheckTrue(chatbot, key):
66
  data = {'AgentCheck': True, 'key': key}
67
  response=requests.post(os.environ.get("URL"), data=json.dumps(data, ensure_ascii=False).encode('utf-8'))
68
+ chatbot.append((parse_text("是。"), parse_text(str(response.content, encoding="utf-8"))))
69
  return chatbot
70
 
71
  def CheckFalse(chatbot, key):
72
  data = {'AgentCheck': False, 'key': key}
73
  response=requests.post(os.environ.get("URL"), data=json.dumps(data, ensure_ascii=False).encode('utf-8'))
74
+ chatbot.append((parse_text("否。"), parse_text(str(response.content, encoding="utf-8"))))
75
  return chatbot
76
 
77
  def CheckIrrelevant(chatbot, key):
78
  data = {'AgentCheck': 'Irrelevant', 'key': key}
79
  response=requests.post(os.environ.get("URL"), data=json.dumps(data, ensure_ascii=False).encode('utf-8'))
80
+ chatbot.append((parse_text("无关。"), parse_text(str(response.content, encoding="utf-8"))))
81
  return chatbot
82
 
83
  def CheckTerm(chatbot, key):
 
93
 
94
  with gr.Blocks() as demo:
95
  gr.HTML("""<h1 align="center">Generative Agents测试平台</h1>""")
96
+ user_key = gr.Textbox(label='密钥', placeholder="Input your key, press enter to apply", lines=1, max_lines=1).style(
97
  container=False)
98
  with gr.Row():
99
  with gr.Column(scale=1):
100
+ story = gr.Textbox(label='汤面', lines=3, max_lines=3).style(
101
  container=False)
102
  with gr.Column(scale=1):
103
+ answer = gr.Textbox(label='汤底', lines=3, max_lines=3).style(
104
  container=False)
105
  chatbot = gr.Chatbot([])
106