Fix an error
Fixes "UnboundLocalError: local variable 'substring_found' referenced before assignment" when loading non-pygmalion models in cai chat mode.
This commit is contained in:
parent
5b0bbfa6e8
commit
a85bb5e9a2
1 changed files with 2 additions and 1 deletions
|
@ -373,6 +373,8 @@ if args.chat or args.cai_chat:
|
|||
else:
|
||||
reply = reply[idx + 1 + len(f"{current}:"):]
|
||||
|
||||
substring_found = False
|
||||
|
||||
if check:
|
||||
reply = reply.split('\n')[0].strip()
|
||||
else:
|
||||
|
@ -385,7 +387,6 @@ if args.chat or args.cai_chat:
|
|||
# Detect if something like "\nYo" is generated just before
|
||||
# "\nYou:" is completed
|
||||
tmp = f"\n{other}:"
|
||||
substring_found = False
|
||||
for j in range(1, len(tmp)):
|
||||
if reply[-j:] == tmp[:j]:
|
||||
substring_found = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue