mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Bugfix for Add Sentence Spacing format option
This commit is contained in:
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
|
||||||
|
Reference in New Issue
Block a user