Fix for prompt not showing up

Fix for sentence splitting eating new lines.
This commit is contained in:
ebolam
2022-10-04 19:18:30 -04:00
parent 68969b72c5
commit 280b67e511
2 changed files with 2 additions and 2 deletions

View File

@@ -1465,7 +1465,7 @@ class KoboldStoryRegister(object):
action_text = self.__str__() action_text = self.__str__()
action_text = "{}{}".format("" if self.story_settings is None else self.story_settings.prompt, action_text) action_text = "{}{}".format("" if self.story_settings is None else self.story_settings.prompt, action_text)
###########action_text_split = [sentence, actions used in sentence, token length, included in AI context]################ ###########action_text_split = [sentence, actions used in sentence, token length, included in AI context]################
action_text_split = [[x+" ", [], 0, False] for x in re.split("(?<=[.!?])\s+", action_text)] action_text_split = [[x+" ", [], 0, False] for x in re.split("(?<=[.!?])[ \t]+", action_text)]
#The last action shouldn't have the extra space from the sentence splitting, so let's remove it #The last action shouldn't have the extra space from the sentence splitting, so let's remove it
action_text_split[-1][0] = action_text_split[-1][0][:-1] action_text_split[-1][0] = action_text_split[-1][0][:-1]

View File

@@ -586,7 +586,7 @@ function var_changed(data) {
scroll_trigger_element = document.getElementById("Selected Text Chunk "+actions[0].id); scroll_trigger_element = document.getElementById("Selected Text Chunk "+actions[0].id);
//if we hit the top, unhide the prompt and clear the scroll trigger //if we hit the top, unhide the prompt and clear the scroll trigger
if (actions[actions.length-1].id == 0) { if (actions[0].id == 0) {
document.getElementById("story_prompt").classList.remove("hidden"); document.getElementById("story_prompt").classList.remove("hidden");
scroll_trigger_element = null; scroll_trigger_element = null;
} }