Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -123,10 +123,11 @@ def render_message(history):
|
|
123 |
<div id="messages" style="display: block; margin-bottom: 10px;">"""
|
124 |
|
125 |
seen_messages = set()
|
|
|
126 |
for user_message, assistant_message, user_profile, assistant_profile, user_pic, assistant_pic in history:
|
127 |
if user_message and ("user", user_message) not in seen_messages:
|
128 |
seen_messages.add(("user", user_message))
|
129 |
-
user_message_html =
|
130 |
messages_html += f"""
|
131 |
<div style='display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 10px;'>
|
132 |
<img src='{user_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-bottom: 5px;'>
|
@@ -135,7 +136,7 @@ def render_message(history):
|
|
135 |
|
136 |
if assistant_message and ("assistant", assistant_message) not in seen_messages:
|
137 |
seen_messages.add(("assistant", assistant_message))
|
138 |
-
assistant_message_html =
|
139 |
messages_html += f"""
|
140 |
<div style='display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 10px;'>
|
141 |
<img src='{assistant_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-bottom: 5px;'>
|
|
|
123 |
<div id="messages" style="display: block; margin-bottom: 10px;">"""
|
124 |
|
125 |
seen_messages = set()
|
126 |
+
|
127 |
for user_message, assistant_message, user_profile, assistant_profile, user_pic, assistant_pic in history:
|
128 |
if user_message and ("user", user_message) not in seen_messages:
|
129 |
seen_messages.add(("user", user_message))
|
130 |
+
user_message_html = user_message.replace('\n', '<br>')
|
131 |
messages_html += f"""
|
132 |
<div style='display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 10px;'>
|
133 |
<img src='{user_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-bottom: 5px;'>
|
|
|
136 |
|
137 |
if assistant_message and ("assistant", assistant_message) not in seen_messages:
|
138 |
seen_messages.add(("assistant", assistant_message))
|
139 |
+
assistant_message_html = assistant_message.replace('\n', '<br>')
|
140 |
messages_html += f"""
|
141 |
<div style='display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 10px;'>
|
142 |
<img src='{assistant_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-bottom: 5px;'>
|