diff --git a/koboldai_settings.py b/koboldai_settings.py index 4e324eca..4d9737a7 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -1504,9 +1504,9 @@ class KoboldStoryRegister(object): else: self.actions[i]["Probabilities"][token_num][token_option]["Used"] = False if "Options" in self.actions[i]: - for option in self.actions[i]["Options"][:]: - if option["text"] == text: - self.actions[i]["Options"].remove(option) + for j in reversed(range(len(self.actions[i]["Options"]))): + if self.actions[i]["Options"][j]["text"] == text: + del self.actions[i]["Options"][j] if old_text != "": self.actions[i]["Options"].append({"text": old_text, "Pinned": False, "Previous Selection": False, "Edited": True}) else: