Skip to content

Commit

Permalink
Don't replace last reply with an empty message
Browse files Browse the repository at this point in the history
  • Loading branch information
oobabooga committed Aug 10, 2023
1 parent 0789554 commit 8dbaa20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,10 @@ def send_last_reply_to_input(history):

def replace_last_reply(text, state):
history = state['history']
if len(history['visible']) > 0:

if len(text.strip()) == 0:
return history
elif len(history['visible']) > 0:
history['visible'][-1][1] = text
history['internal'][-1][1] = apply_extensions('input', text, state)

Expand Down

0 comments on commit 8dbaa20

Please sign in to comment.