mpsk commited on
Commit
17c6622
β€’
1 Parent(s): 401cf68

Update chat.py

Browse files
Files changed (1) hide show
  1. chat.py +4 -1
chat.py CHANGED
@@ -96,7 +96,10 @@ if login():
96
  print(type(msg.content))
97
  st.write(f"*{datetime.datetime.fromtimestamp(msg.additional_kwargs['timestamp']).isoformat()}*")
98
  st.write("Retrieved from knowledge base:")
99
- st.dataframe(pd.DataFrame.from_records(map(dict, eval(msg.content))))
 
 
 
100
  else:
101
  if len(msg.content) > 0:
102
  with st.chat_message(speaker):
 
96
  print(type(msg.content))
97
  st.write(f"*{datetime.datetime.fromtimestamp(msg.additional_kwargs['timestamp']).isoformat()}*")
98
  st.write("Retrieved from knowledge base:")
99
+ try:
100
+ st.dataframe(pd.DataFrame.from_records(map(dict, eval(msg.content))))
101
+ except:
102
+ st.write(msg.content)
103
  else:
104
  if len(msg.content) > 0:
105
  with st.chat_message(speaker):