mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
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:
parent
a90f507abe
commit
ca47e016b4
@ -142,22 +142,23 @@ def generate_chat_html(history, name1, name2, character):
|
||||
</div>
|
||||
"""
|
||||
|
||||
if not (i == len(history)-1 and len(row[0]) == 0):
|
||||
output += f"""
|
||||
<div class="message">
|
||||
<div class="circle-you">
|
||||
{img_me}
|
||||
</div>
|
||||
<div class="text">
|
||||
<div class="username">
|
||||
{name1}
|
||||
</div>
|
||||
<div class="message-body">
|
||||
{row[0]}
|
||||
</div>
|
||||
</div>
|
||||
if not row[0]: # don't display empty user messages
|
||||
continue
|
||||
output += f"""
|
||||
<div class="message">
|
||||
<div class="circle-you">
|
||||
{img_me}
|
||||
</div>
|
||||
<div class="text">
|
||||
<div class="username">
|
||||
{name1}
|
||||
</div>
|
||||
"""
|
||||
<div class="message-body">
|
||||
{row[0]}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
"""
|
||||
|
||||
output += "</div>"
|
||||
return output
|
||||
|
Loading…
Reference in New Issue
Block a user