Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions generate/clean-outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ def clean_output(prompt: str, output: str) -> str:
if output.strip().startswith(last_line_of_prompt):
output = output.replace(last_line_of_prompt, '', 1)

# we expect outputs to not start with the opening { bracket. We add that later in the drivers;
# remove it here if present
if output.strip().startswith('{'):
output = output.replace('{', '', 1)

if has_balanced_brackets("{" + output + "}"):
output = output + '}'

Expand Down