Skip to content

Commit

Permalink
Hallucination fix
Browse files Browse the repository at this point in the history
Hallucination fix
  • Loading branch information
KillianLucas authored Aug 11, 2024
2 parents 308fc25 6c3058a commit d22949d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions interpreter/core/respond.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 181,16 @@ def respond(interpreter):
except:
pass

# print(code)
# print("---")
# time.sleep(2)

if code.strip().endswith("executeexecute"):
edited_code = code.replace("executeexecute", "")
code = code.replace("executeexecute", "")
try:
code_dict = json.loads(edited_code)
language = code_dict.get("language", language)
code = code_dict.get("code", code)
interpreter.messages[-1][
"content"
] = code # So the LLM can see it.
interpreter.messages[-1][
"format"
] = language # So the LLM can see it.
except:
pass

Expand Down

0 comments on commit d22949d

Please sign in to comment.