Do not display empty user messages in chat mode.

There doesn't seem to be much value to them - they just take up space while also making it seem like there's still some sort of pseudo-dialogue going on, instead of a monologue by the bot.
This commit is contained in:
Vladimir Belitskiy 2023-03-20 12:55:57 -04:00 committed by GitHub
parent a90f507abe
commit ca47e016b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,22 +142,23 @@ def generate_chat_html(history, name1, name2, character):
</div> </div>
""" """
if not (i == len(history)-1 and len(row[0]) == 0): if not row[0]: # don't display empty user messages
output += f""" continue
<div class="message"> output += f"""
<div class="circle-you"> <div class="message">
{img_me} <div class="circle-you">
</div> {img_me}
<div class="text"> </div>
<div class="username"> <div class="text">
{name1} <div class="username">
</div> {name1}
<div class="message-body">
{row[0]}
</div>
</div>
</div> </div>
""" <div class="message-body">
{row[0]}
</div>
</div>
</div>
"""
output += "</div>" output += "</div>"
return output return output