long1104 commited on
Commit
388c586
1 Parent(s): 2a24833

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -405,14 +405,15 @@ def process_button_click(head, button_index, topic_desc, top_concept_index):
405
  topic_text_index = 'topic_' + str(button_index)
406
  topic_text = head.ca._df[topic_text_index][top_concept_index]
407
 
408
- response = head.answering_agent.generate_response_topic(topic_desc, topic_text, head.get_conversation(), head.selected_mode)
409
- image, caption = head.answering_agent.generate_image(topic_text)
410
- topic = topic_desc
411
-
412
- st.session_state.topic_matrix[top_concept_index][button_index] += 1
413
-
414
- with st.chat_message("assistant"): st.write(response)
415
- if image and caption != "": st.image(image, caption)
 
416
 
417
  # ... (add response & image to message)
418
  st.session_state.messages.append({"role": "user", "content": topic_desc, "topic": "ml", "image": None})
 
405
  topic_text_index = 'topic_' + str(button_index)
406
  topic_text = head.ca._df[topic_text_index][top_concept_index]
407
 
408
+ with st.chat_message("assistant"):
409
+ response = head.answering_agent.generate_response_topic(topic_desc, topic_text, head.get_conversation(), head.selected_mode)
410
+ image, caption = head.answering_agent.generate_image(topic_text)
411
+ topic = topic_desc
412
+
413
+ st.session_state.topic_matrix[top_concept_index][button_index] += 1
414
+
415
+ st.write(response)
416
+ if image and caption != "": st.image(image, caption)
417
 
418
  # ... (add response & image to message)
419
  st.session_state.messages.append({"role": "user", "content": topic_desc, "topic": "ml", "image": None})