Skip to content

Commit e8cb680

Browse files
authored
[Evaluation] Improve patch apply in SWE-Bench (#2684)
* add newline after patch to fix patch apply * only add newline if not empty
1 parent 7d31057 commit e8cb680

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

evaluation/swe_bench/scripts/eval/convert_od_output_to_swe_json.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
def convert_row_to_swebench_format(row):
1818
return {
1919
'instance_id': row['instance_id'],
20-
'model_patch': row['git_patch'].replace('\r\n', '\n'),
20+
'model_patch': row['git_patch'].replace('\r\n', '\n').rstrip() + '\n'
21+
if row['git_patch'].strip()
22+
else '',
2123
'model_name_or_path': model_name,
2224
}
2325

0 commit comments

Comments
 (0)