From 9963df3e2b67dc0ebfe2790acfb9711a4265f8e3 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Mon, 27 Nov 2023 10:24:31 +0100 Subject: [PATCH] Update personality.py --- lollms/personality.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lollms/personality.py b/lollms/personality.py index 24b85d5..5d97eb1 100644 --- a/lollms/personality.py +++ b/lollms/personality.py @@ -1631,7 +1631,10 @@ class APScript(StateMachine): import autopep8 global_prompt = f"{prompt}\n!@>Code Builder:```python\n" code = self.fast_gen(global_prompt, max_title_length) - back_quote_index = code.index("```") # Remove trailing backticks + try: + back_quote_index = code.index("```") # Remove trailing backticks + except: + pass if back_quote_index>=0: # Removing any extra text code = code[:back_quote_index]