Skip to content

Commit

Permalink
Merge pull request #52 from ServiceNow/gasse/patch_14
Browse files Browse the repository at this point in the history
Keyboard interrupt log bugfix
  • Loading branch information
ThibaultLSDC authored May 29, 2024
2 parents c53647d + ffb758e commit c63da82
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions experiments/src/browsergym/experiments/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ def run(self):
except Exception as e:
logger.error(f"Error while saving step info in the finally block: {e}")
try:
if (
not err_msg
and len(episode_info) > 0
and not (episode_info[-1].terminated or episode_info[-1].truncated)
):
e = KeyboardInterrupt("Early termination??")
err_msg = f"Exception uncaught by agent or environment in task {self.env_args.task_name}.\n{type(e).__name__}:\n{e}"
_save_summary_info(episode_info, self.exp_dir, err_msg, stack_trace)
except Exception as e:
logger.error(f"Error while saving summary info in the finally block: {e}")
Expand Down

0 comments on commit c63da82

Please sign in to comment.