Update personality.py

This commit is contained in:
Saifeddine ALOUI 2023-11-27 10:24:31 +01:00 committed by GitHub
parent 6a4c48c724
commit 9963df3e2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
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]