timeki commited on
Commit
a207af9
1 Parent(s): 9d06027

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -17
app.py CHANGED
@@ -232,23 +232,24 @@ async def chat(query,history,audience,sources,reports):
232
  except Exception as e:
233
  print(f"Skipped adding image {i} because of {e}")
234
 
235
- if len(image_dict) > 0:
236
-
237
- gallery = [x["img"] for x in list(image_dict.values())]
238
- img = list(image_dict.values())[0]
239
- img_md = img["md"]
240
- img_caption = img["caption"]
241
- img_code = img["figure_code"]
242
- if img_code != "N/A":
243
- img_name = f"{img['key']} - {img['figure_code']}"
244
- else:
245
- img_name = f"{img['key']}"
246
-
247
- answer_yet = history[-1][1] + f"\n\n{img_md}\n<p class='chatbot-caption'><b>{img_name}</b> - {img_caption}</p>"
248
- history[-1] = (history[-1][0],answer_yet)
249
- history = [tuple(x) for x in history]
250
-
251
- yield history,docs_html,output_query,output_language,gallery#,output_query,output_keywords
 
252
 
253
 
254
  def save_feedback(feed: str, user_id):
 
232
  except Exception as e:
233
  print(f"Skipped adding image {i} because of {e}")
234
 
235
+ ## temp removing
236
+ # if len(image_dict) > 0:
237
+
238
+ # gallery = [x["img"] for x in list(image_dict.values())]
239
+ # img = list(image_dict.values())[0]
240
+ # img_md = img["md"]
241
+ # img_caption = img["caption"]
242
+ # img_code = img["figure_code"]
243
+ # if img_code != "N/A":
244
+ # img_name = f"{img['key']} - {img['figure_code']}"
245
+ # else:
246
+ # img_name = f"{img['key']}"
247
+
248
+ # answer_yet = history[-1][1] + f"\n\n{img_md}\n<p class='chatbot-caption'><b>{img_name}</b> - {img_caption}</p>"
249
+ # history[-1] = (history[-1][0],answer_yet)
250
+ # history = [tuple(x) for x in history]
251
+
252
+ # yield history,docs_html,output_query,output_language,gallery#,output_query,output_keywords
253
 
254
 
255
  def save_feedback(feed: str, user_id):