mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-01-12 16:15:21 +01:00
Don't add sentence spacing if submission is empty
When you retry, it actually sends an empty submission, so if you have
add sentence spacing on, retrying could add an extra action with a
single space.
(cherry picked from commit 151407a001
)
This commit is contained in:
parent
9d09ae5fea
commit
6ba7429eea
3
utils.py
3
utils.py
@ -91,6 +91,9 @@ def removespecialchars(txt, vars=None):
|
||||
# If the next action follows a sentence closure, add a space
|
||||
#==================================================================#
|
||||
def addsentencespacing(txt, vars):
|
||||
# Don't add sentence spacing if submission is empty or starts with whitespace
|
||||
if(len(txt) == 0 or len(txt) != len(txt.lstrip())):
|
||||
return txt
|
||||
# Get last character of last action
|
||||
if(len(vars.actions) > 0):
|
||||
if(len(vars.actions[vars.actions.get_last_key()]) > 0):
|
||||
|
Loading…
Reference in New Issue
Block a user