mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-25 16:08:00 +01:00
Bugfix for Add Sentence Spacing format option
This commit is contained in:
parent
c9b6f89d1d
commit
0e038b8727
7
utils.py
7
utils.py
@ -66,9 +66,12 @@ def removespecialchars(txt):
|
|||||||
#==================================================================#
|
#==================================================================#
|
||||||
# If the next action follows a sentence closure, add a space
|
# If the next action follows a sentence closure, add a space
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
def addsentencespacing(txt, acts):
|
def addsentencespacing(txt, vars):
|
||||||
# Get last character of last action
|
# Get last character of last action
|
||||||
lastchar = acts[-1][-1]
|
if(len(vars.actions) > 0):
|
||||||
|
lastchar = vars.actions[-1][-1]
|
||||||
|
else:
|
||||||
|
lastchar = vars.prompt[-1]
|
||||||
if(lastchar == "." or lastchar == "!" or lastchar == "?" or lastchar == "," or lastchar == ";" or lastchar == ":"):
|
if(lastchar == "." or lastchar == "!" or lastchar == "?" or lastchar == "," or lastchar == ";" or lastchar == ":"):
|
||||||
txt = " " + txt
|
txt = " " + txt
|
||||||
return txt
|
return txt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user