Add "save defaults to settings.yaml" button (#3574)

This commit is contained in:
oobabooga 2023-08-14 11:46:07 -03:00 committed by GitHub
parent a95e6f02cb
commit 619cb4e78b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 82 additions and 52 deletions

View file

@ -261,7 +261,7 @@ def chatbot_wrapper(text, state, regenerate=False, _continue=False, loading_mess
yield output
def impersonate_wrapper(text, start_with, state):
def impersonate_wrapper(text, state):
if shared.model_name == 'None' or shared.model is None:
logger.error("No model is loaded! Select one in the Model tab.")
yield ''
@ -291,15 +291,15 @@ def generate_chat_reply(text, state, regenerate=False, _continue=False, loading_
# Same as above but returns HTML for the UI
def generate_chat_reply_wrapper(text, start_with, state, regenerate=False, _continue=False):
if start_with != '' and not _continue:
def generate_chat_reply_wrapper(text, state, regenerate=False, _continue=False):
if state['start_with'] != '' and not _continue:
if regenerate:
text, state['history'] = remove_last_message(state['history'])
regenerate = False
_continue = True
send_dummy_message(text, state)
send_dummy_reply(start_with, state)
send_dummy_reply(state['start_with'], state)
for i, history in enumerate(generate_chat_reply(text, state, regenerate, _continue, loading_message=True)):
yield chat_html_wrapper(history, state['name1'], state['name2'], state['mode'], state['chat_style']), history