Don't regenerate if no message has been sent
This commit is contained in:
parent
6160a03984
commit
589069e105
1 changed files with 12 additions and 6 deletions
|
@ -612,6 +612,12 @@ def cai_chatbot_wrapper(text, tokens, do_sample, max_new_tokens, temperature, to
|
||||||
yield generate_chat_html(_history, name1, name2, character)
|
yield generate_chat_html(_history, name1, name2, character)
|
||||||
|
|
||||||
def regenerate_wrapper(text, tokens, do_sample, max_new_tokens, temperature, top_p, typical_p, repetition_penalty, top_k, min_length, no_repeat_ngram_size, num_beams, penalty_alpha, length_penalty, early_stopping, name1, name2, context, check, chat_prompt_size, picture=None):
|
def regenerate_wrapper(text, tokens, do_sample, max_new_tokens, temperature, top_p, typical_p, repetition_penalty, top_k, min_length, no_repeat_ngram_size, num_beams, penalty_alpha, length_penalty, early_stopping, name1, name2, context, check, chat_prompt_size, picture=None):
|
||||||
|
if character is not None and len(history['visible']) == 1:
|
||||||
|
if args.cai_chat:
|
||||||
|
yield generate_chat_html(history['visible'], name1, name2, character)
|
||||||
|
else:
|
||||||
|
yield history['visible']
|
||||||
|
else:
|
||||||
last_visible = history['visible'].pop()
|
last_visible = history['visible'].pop()
|
||||||
last_internal = history['internal'].pop()
|
last_internal = history['internal'].pop()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue