Skip to content

Commit

Permalink
Do not attempt to save patch with empty patch (#242)
Browse files Browse the repository at this point in the history
* Fixed a potential error

I've ran into this error several times, where it says model_patch can't be None and ending the entire program.

* Do not attempt to save patch with empty patch

---------

Co-authored-by: Kilian Lieret <kilian.lieret@posteo.de>
  • Loading branch information
DanjieTang and klieret committed Apr 16, 2024
1 parent 3e5b4ee commit 5d938f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def save_patch(traj_dir: Path, instance_id: str, info) -> Optional[Path]:
patch_output_dir = traj_dir / "patches"
patch_output_dir.mkdir(exist_ok=True, parents=True)
patch_output_file = patch_output_dir / f"{instance_id}.patch"
if not "submission" in info:
if not info.get("submission"):
logger.info("No patch to save.")
return
model_patch = info["submission"]
Expand Down

0 comments on commit 5d938f0

Please sign in to comment.