RoAr777 commited on
Commit
910c46a
·
verified ·
1 Parent(s): 394a06f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -382,13 +382,11 @@ def chatbot_response(history,query):
382
  response = result['output']
383
  intermediate_steps = result.get('intermediate_steps', [])
384
 
385
- thought_process = """
386
- <div style="font-size: 12px; font-weight: bold;">"""
387
  for action, observation in intermediate_steps:
388
- thought_process += f"**Thought:** {action.log}\n"
389
- thought_process += f"**Action:** {action.tool}\n"
390
- thought_process += f"**Observation:** {observation}\n\n"
391
- thought_process+="</div>"
392
  return response, thought_process.strip()
393
  # Step 5: Gradio Interface
394
  from gradio import ChatMessage
@@ -427,8 +425,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
427
  chatbot = gr.Chatbot(type="messages",avatar_images=("user.jpeg", "logo.jpeg"), bubble_full_width=True) # Chatbot component to display conversation history
428
  query_input = gr.MultimodalTextbox(interactive=True,
429
  placeholder="Enter message or upload file...", show_label=False)
430
- submit_button = gr.Button("Send")
431
-
432
 
433
  query_input.submit(chatbot_interface, [chatbot, query_input], [chatbot,query_input])
434
 
 
382
  response = result['output']
383
  intermediate_steps = result.get('intermediate_steps', [])
384
 
385
+ thought_process = ""
 
386
  for action, observation in intermediate_steps:
387
+ thought_process += f"Thought: {action.log}\n"
388
+ thought_process += f"Action: {str(action.tool).replace('`','')}\n"
389
+ thought_process += f"Observation: {observation}\n\n"
 
390
  return response, thought_process.strip()
391
  # Step 5: Gradio Interface
392
  from gradio import ChatMessage
 
425
  chatbot = gr.Chatbot(type="messages",avatar_images=("user.jpeg", "logo.jpeg"), bubble_full_width=True) # Chatbot component to display conversation history
426
  query_input = gr.MultimodalTextbox(interactive=True,
427
  placeholder="Enter message or upload file...", show_label=False)
428
+
 
429
 
430
  query_input.submit(chatbot_interface, [chatbot, query_input], [chatbot,query_input])
431