Skip to content

Commit 9e2a9af

Browse files
authored
add extra pass when cleaning outputs (#57)
1 parent ee66dc5 commit 9e2a9af

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

generate/clean-outputs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ def clean_output(prompt: str, output: str) -> str:
2222
if output.strip().startswith(last_line_of_prompt):
2323
output = output.replace(last_line_of_prompt, '', 1)
2424

25+
# we expect outputs to not start with the opening { bracket. We add that later in the drivers;
26+
# remove it here if present
27+
if output.strip().startswith('{'):
28+
output = output.replace('{', '', 1)
29+
2530
if has_balanced_brackets("{" + output + "}"):
2631
output = output + '}'
2732

0 commit comments

Comments
 (0)