|
@@ -119,13 +119,13 @@ def load_html_image(paths):
|
|
|
|
|
|
|
|
def generate_chat_html(history, name1, name2, character):
|
|
def generate_chat_html(history, name1, name2, character):
|
|
|
output = f'<style>{cai_css}</style><div class="chat" id="chat">'
|
|
output = f'<style>{cai_css}</style><div class="chat" id="chat">'
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
img_bot = load_html_image([f"characters/{character}.{ext}" for ext in ['png', 'jpg', 'jpeg']] + ["img_bot.png","img_bot.jpg","img_bot.jpeg"])
|
|
img_bot = load_html_image([f"characters/{character}.{ext}" for ext in ['png', 'jpg', 'jpeg']] + ["img_bot.png","img_bot.jpg","img_bot.jpeg"])
|
|
|
img_me = load_html_image(["img_me.png", "img_me.jpg", "img_me.jpeg"])
|
|
img_me = load_html_image(["img_me.png", "img_me.jpg", "img_me.jpeg"])
|
|
|
|
|
|
|
|
for i,_row in enumerate(history[::-1]):
|
|
for i,_row in enumerate(history[::-1]):
|
|
|
row = [convert_to_markdown(entry) for entry in _row]
|
|
row = [convert_to_markdown(entry) for entry in _row]
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
output += f"""
|
|
output += f"""
|
|
|
<div class="message">
|
|
<div class="message">
|
|
|
<div class="circle-bot">
|
|
<div class="circle-bot">
|
|
@@ -142,8 +142,9 @@ def generate_chat_html(history, name1, name2, character):
|
|
|
</div>
|
|
</div>
|
|
|
"""
|
|
"""
|
|
|
|
|
|
|
|
- if not row[0]: # don't display empty user messages
|
|
|
|
|
|
|
+ if len(row[0]) == 0: # don't display empty user messages
|
|
|
continue
|
|
continue
|
|
|
|
|
+
|
|
|
output += f"""
|
|
output += f"""
|
|
|
<div class="message">
|
|
<div class="message">
|
|
|
<div class="circle-you">
|
|
<div class="circle-you">
|