Skip to content

Commit

Permalink
[Evaluation] Improve patch apply in SWE-Bench (#2684)
Browse files Browse the repository at this point in the history
* add newline after patch to fix patch apply

* only add newline if not empty
  • Loading branch information
xingyaoww committed Jun 29, 2024
1 parent 7d31057 commit e8cb680
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
def convert_row_to_swebench_format(row):
return {
'instance_id': row['instance_id'],
'model_patch': row['git_patch'].replace('\r\n', '\n'),
'model_patch': row['git_patch'].replace('\r\n', '\n').rstrip() + '\n'
if row['git_patch'].strip()
else '',
'model_name_or_path': model_name,
}

Expand Down

0 comments on commit e8cb680

Please sign in to comment.