mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Fixed double space removal to also remove double spaces that span actions
This commit is contained in:
@@ -1261,6 +1261,9 @@ class KoboldStoryRegister(object):
|
|||||||
if self.koboldai_vars.remove_double_space:
|
if self.koboldai_vars.remove_double_space:
|
||||||
while " " in text:
|
while " " in text:
|
||||||
text = text.replace(" ", " ")
|
text = text.replace(" ", " ")
|
||||||
|
if i > 0:
|
||||||
|
if self.actions[i-1]['Selected Text'][-1] == " " and text[0] == " ":
|
||||||
|
text = text[1:]
|
||||||
if i in self.actions:
|
if i in self.actions:
|
||||||
old = self.actions[i]
|
old = self.actions[i]
|
||||||
old_text = self.actions[i]["Selected Text"]
|
old_text = self.actions[i]["Selected Text"]
|
||||||
@@ -1334,6 +1337,9 @@ class KoboldStoryRegister(object):
|
|||||||
if self.koboldai_vars.remove_double_space:
|
if self.koboldai_vars.remove_double_space:
|
||||||
while " " in text:
|
while " " in text:
|
||||||
text = text.replace(" ", " ")
|
text = text.replace(" ", " ")
|
||||||
|
if action_id_offset > 0:
|
||||||
|
if self.actions[action_id_offset-1]['Selected Text'][-1] == " " and text[0] == " ":
|
||||||
|
text = text[1:]
|
||||||
self.clear_unused_options()
|
self.clear_unused_options()
|
||||||
self.action_count+=1
|
self.action_count+=1
|
||||||
action_id = self.action_count + action_id_offset
|
action_id = self.action_count + action_id_offset
|
||||||
|
Reference in New Issue
Block a user