From 73b1e551fa210e05375364fbee49d3bb3fb15f8d Mon Sep 17 00:00:00 2001 From: somebody Date: Thu, 15 Sep 2022 22:13:54 -0500 Subject: [PATCH] Polish and bugfixes on import variables --- aiserver.py | 5 +---- static/koboldai.js | 1 - templates/popups.html | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/aiserver.py b/aiserver.py index 58fdf2e7..732f67a2 100644 --- a/aiserver.py +++ b/aiserver.py @@ -339,15 +339,12 @@ class ImportBuffer: def _replace_placeholders(self, text: str, ph_ids: dict): for ph_id, value in ph_ids.items(): - print(f"iterating upon {ph_id=}") - pattern = "\${(?:\d#)?%s.*?}" % ph_id + pattern = "\${(?:\d#)?%s.*?}" % re.escape(ph_id) for ph_text in re.findall(pattern, text): - print(f"instance of {ph_id} in text, replaceing with {value}") text = text.replace(ph_text, value) return text def replace_placeholders(self, ph_ids: dict): - print(f"Replacing with {ph_ids}") self.prompt = self._replace_placeholders(self.prompt, ph_ids) self.memory = self._replace_placeholders(self.memory, ph_ids) self.authors_note = self._replace_placeholders(self.authors_note, ph_ids) diff --git a/static/koboldai.js b/static/koboldai.js index c60a9a50..079ee749 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -3474,7 +3474,6 @@ function sendPromptConfiguration() { socket.emit("configure_prompt", data); - document.querySelector("#popup").classList.add("hidden"); document.querySelector("#prompt-config-container").classList.add("hidden"); $(".prompt-config-ph").remove(); } diff --git a/templates/popups.html b/templates/popups.html index e8d5c3e1..2ea3b71b 100644 --- a/templates/popups.html +++ b/templates/popups.html @@ -113,7 +113,7 @@