mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-09-20 18:45:09 +02:00
Fix a bug in cai mode chat
This commit is contained in:
parent
e6691bd920
commit
bb1a172da0
1 changed files with 6 additions and 4 deletions
|
@ -222,6 +222,10 @@ elif args.chat or args.cai_chat:
|
|||
|
||||
question = context+'\n\n'
|
||||
for i in range(len(history)):
|
||||
if args.cai_chat:
|
||||
question += f"{name1}: {history[i][0].strip()}\n"
|
||||
question += f"{name2}: {history[i][1].strip()}\n"
|
||||
else:
|
||||
question += f"{name1}: {history[i][0][3:-5].strip()}\n"
|
||||
question += f"{name2}: {history[i][1][3:-5].strip()}\n"
|
||||
question += f"{name1}: {text}\n"
|
||||
|
@ -294,8 +298,6 @@ elif args.chat or args.cai_chat:
|
|||
with gr.Row():
|
||||
check = gr.Checkbox(value=settings['stop_at_newline'], label='Stop generating at new line character?')
|
||||
|
||||
|
||||
|
||||
if args.cai_chat:
|
||||
btn.click(cai_chatbot_wrapper, [textbox, length_slider, preset_menu, model_menu, name1, name2, context, check], display1, show_progress=True, api_name="textgen")
|
||||
textbox.submit(cai_chatbot_wrapper, [textbox, length_slider, preset_menu, model_menu, name1, name2, context, check], display1, show_progress=True)
|
||||
|
|
Loading…
Reference in a new issue