arde0909 commited on
Commit
b0c0b87
1 Parent(s): 307635e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -7,12 +7,12 @@ def handle_query(query):
7
  for result in sanchaari(query):
8
  if "thought" in result:
9
  thoughts.append(result["thought"])
10
- yield {"Thought Process": "\n".join(thoughts), "Response Text": ""}
11
  if "final_answer" in result:
12
  final_answer = result["final_answer"]
13
- yield {"Thought Process": "\n".join(thoughts), "Response Text": final_answer}
14
 
15
- with gr.Blocks(css="footer {visibility: hidden}") as demo:
16
  gr.Markdown(
17
  """
18
  # Antarjaala Sanchaari: Your Versatile AI Assistant
@@ -31,7 +31,8 @@ with gr.Blocks(css="footer {visibility: hidden}") as demo:
31
  submit_btn = gr.Button("Ask Sanchaari", variant="primary")
32
 
33
  with gr.Column(scale=3):
34
- output = gr.JSON(label="Sanchaari's Response")
 
35
 
36
  gr.Markdown(
37
  """
@@ -52,6 +53,6 @@ with gr.Blocks(css="footer {visibility: hidden}") as demo:
52
  """
53
  )
54
 
55
- submit_btn.click(handle_query, inputs=query_input, outputs=output)
56
 
57
  demo.launch(share=True)
 
7
  for result in sanchaari(query):
8
  if "thought" in result:
9
  thoughts.append(result["thought"])
10
+ yield "\n".join(thoughts), ""
11
  if "final_answer" in result:
12
  final_answer = result["final_answer"]
13
+ yield "\n".join(thoughts), final_answer
14
 
15
+ with gr.Blocks(theme=gr.themes.Soft()) as demo:
16
  gr.Markdown(
17
  """
18
  # Antarjaala Sanchaari: Your Versatile AI Assistant
 
31
  submit_btn = gr.Button("Ask Sanchaari", variant="primary")
32
 
33
  with gr.Column(scale=3):
34
+ thought_output = gr.Textbox(label="Thought Process", lines=5)
35
+ response_output = gr.Textbox(label="Sanchaari's Response", lines=3)
36
 
37
  gr.Markdown(
38
  """
 
53
  """
54
  )
55
 
56
+ submit_btn.click(handle_query, inputs=query_input, outputs=[thought_output, response_output])
57
 
58
  demo.launch(share=True)