mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Change a truncation parameter
This commit is contained in:
parent
54bf55372b
commit
3a99b2b030
@ -232,12 +232,12 @@ elif args.chat or args.cai_chat:
|
|||||||
|
|
||||||
if check:
|
if check:
|
||||||
reply = generate_reply(question, tokens, inference_settings, selected_model, eos_token='\n')[0]
|
reply = generate_reply(question, tokens, inference_settings, selected_model, eos_token='\n')[0]
|
||||||
idx = reply.rfind(question[-500:])
|
idx = reply.rfind(question[-1024:])
|
||||||
reply = reply[idx+min(500, len(question)):].split('\n')[0].strip()
|
reply = reply[idx+min(1024, len(question)):].split('\n')[0].strip()
|
||||||
else:
|
else:
|
||||||
reply = generate_reply(question, tokens, inference_settings, selected_model)[0]
|
reply = generate_reply(question, tokens, inference_settings, selected_model)[0]
|
||||||
idx = reply.rfind(question[-500:])
|
idx = reply.rfind(question[-1024:])
|
||||||
reply = reply[idx+min(500, len(question)):]
|
reply = reply[idx+min(1024, len(question)):]
|
||||||
idx = reply.find(f"\n{name1}:")
|
idx = reply.find(f"\n{name1}:")
|
||||||
if idx != -1:
|
if idx != -1:
|
||||||
reply = reply[:idx]
|
reply = reply[:idx]
|
||||||
|
Loading…
Reference in New Issue
Block a user