sophcheng commited on
Commit
bf79fbd
·
verified ·
1 Parent(s): bc67980

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -153,6 +153,16 @@ with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
153
  question = gr.Textbox(label="Your question", placeholder="What do you want to ask about?")
154
  answer = gr.Textbox(label="AI-nstein Response", placeholder="AI-nstein will respond here...", interactive=False, lines=10)
155
  submit_button = gr.Button("Submit")
 
 
 
 
 
 
 
 
 
 
156
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
157
 
158
 
 
153
  question = gr.Textbox(label="Your question", placeholder="What do you want to ask about?")
154
  answer = gr.Textbox(label="AI-nstein Response", placeholder="AI-nstein will respond here...", interactive=False, lines=10)
155
  submit_button = gr.Button("Submit")
156
+
157
+ answer = gr.Textbox(label="ChessBot Response", placeholder="ChessBot's response is...", interactive=False, lines=5)
158
+ submit_button = gr.Button("Submit")
159
+
160
+ def display_response(question):
161
+ response, confidence_score = query_model(question)
162
+ answer.value = f"Response: {response}\nConfidence Score: {confidence_score:.2f}"
163
+
164
+ submit_button.click(fn=display_response, inputs=question, outputs=None)
165
+
166
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
167
 
168