Spaces:
Build error
Build error
Update app.py
Browse files125 unmodified lines1261271281291301311322 unmodified lines1351361371381391401412 unmodified lines144145146147148149150151152153154155156157158125 unmodified linesfor user_message, assistant_message, user_profile, assistant_profile, user_pic, assistant_pic in history:if user_message and user_message not in seen_messages:seen_messages.add(user_message)user_message_html = markdown.markdown(escape_html(user_message), extensions=["fenced_code", "codehilite"])messages_html += f"""<div style='display: flex; align-items: center; margin-bottom: 10px;'><img src='{user_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>2 unmodified linesif assistant_message and assistant_message not in seen_messages:seen_messages.add(assistant_message)assistant_message_html = markdown.markdown(escape_html(assistant_message), extensions=["fenced_code", "codehilite"])messages_html += f"""<div style='display: flex; align-items: center; margin-bottom: 10px;'><img src='{assistant_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>2 unmodified linesmessages_html += "</div></div>"return messages_htmldef escape_html(unsafe_text):return (unsafe_text.replace("&", "&").replace("<", "<").replace(">", ">").replace('"', """).replace("'", "'"))css=""".chatbox {height: 400px; overflow: auto; border: 1px solid #262626; padding: 10px; background-color: #171717; display: flex; flex-direction: column-reverse;}125 unmodified lines1261271281291301311322 unmodified lines1351361371381391401412 unmodified lines144145146147148149150151152153154125 unmodified linesfor user_message, assistant_message, user_profile, assistant_profile, user_pic, assistant_pic in history:if user_message and user_message not in seen_messages:seen_messages.add(user_message)user_message_html = escape_html(user_message)messages_html += f"""<div style='display: flex; align-items: center; margin-bottom: 10px;'><img src='{user_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>2 unmodified linesif assistant_message and assistant_message not in seen_messages:seen_messages.add(assistant_message)assistant_message_html = escape_html(assistant_message)messages_html += f"""<div style='display: flex; align-items: center; margin-bottom: 10px;'><img src='{assistant_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>2 unmodified linesmessages_html += "</div></div>"return messages_htmldef escape_html(unsafe_text):return ''.join(f"&#{ord(char)};" for char in unsafe_text)css=""".chatbox {height: 400px; overflow: auto; border: 1px solid #262626; padding: 10px; background-color: #171717; display: flex; flex-direction: column-reverse;}
app.py+6-10