Skip to content

Commit

Permalink
Bugfix for Add Sentence Spacing format option
Browse files Browse the repository at this point in the history
  • Loading branch information
KoboldAI committed May 14, 2021
1 parent c9b6f89 commit 0e038b8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ def removespecialchars(txt):
#==================================================================#
# 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
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 == ":"):
txt = " " + txt
return txt
Expand Down

0 comments on commit 0e038b8

Please sign in to comment.