From d43d150b1ee071a828b51d0b64c7d06c22c0a76a Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 22 Sep 2023 09:40:07 -0700 Subject: [PATCH] Fix a bug in the chat API (closes #4034) --- extensions/api/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/api/util.py b/extensions/api/util.py index 0b840155..e4f7738f 100644 --- a/extensions/api/util.py +++ b/extensions/api/util.py @@ -66,6 +66,8 @@ def build_parameters(body, chat=False): instruction_template = body.get('instruction_template', shared.settings['instruction_template']) if str(instruction_template) == "None": instruction_template = "Vicuna-v1.1" + if str(character) == "None": + character = "Assistant" name1, name2, _, greeting, context, _ = load_character_memoized(character, str(body.get('your_name', shared.settings['name1'])), '', instruct=False) name1_instruct, name2_instruct, _, _, context_instruct, turn_template = load_character_memoized(instruction_template, '', '', instruct=True)