research14 commited on
Commit
5a10654
·
1 Parent(s): 8a7ac62
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -24,11 +24,8 @@ def respond(message, chat_history):
24
  time.sleep(2)
25
  return "", chat_history
26
 
27
- def send_button_click(prompt, api_key, chatbot):
28
- # Perform actions with both the prompt and api_key
29
- print(f"Prompt: {prompt}, API Key: {api_key}")
30
-
31
- # Call the respond function
32
  respond(prompt, chatbot)
33
 
34
  def interface(tab_name):
@@ -58,7 +55,9 @@ def interface(tab_name):
58
  gpt_S3_chatbot = gr.Chatbot(label="gpt-3.5")
59
  clear = gr.ClearButton([textbox_prompt, vicuna_S3_chatbot])
60
 
61
- send_button = gr.Button(text="Send", onclick=send_button_click, args=[textbox_prompt, api_key, vicuna_S1_chatbot])
 
 
62
 
63
  with gr.Blocks() as demo:
64
  gr.Markdown("# LLM Evaluator With Linguistic Scrutiny")
 
24
  time.sleep(2)
25
  return "", chat_history
26
 
27
+ def textbox_submit(tab_name, textbox, chatbot):
28
+ prompt = template_single.format(tab_name, textbox.value)
 
 
 
29
  respond(prompt, chatbot)
30
 
31
  def interface(tab_name):
 
55
  gpt_S3_chatbot = gr.Chatbot(label="gpt-3.5")
56
  clear = gr.ClearButton([textbox_prompt, vicuna_S3_chatbot])
57
 
58
+ textbox_prompt.submit(textbox_submit, tab_name, textbox_prompt, vicuna_S1_chatbot)
59
+ textbox_prompt.submit(textbox_submit, tab_name, textbox_prompt, vicuna_S2_chatbot)
60
+ textbox_prompt.submit(textbox_submit, tab_name, textbox_prompt, vicuna_S3_chatbot)
61
 
62
  with gr.Blocks() as demo:
63
  gr.Markdown("# LLM Evaluator With Linguistic Scrutiny")