Skip to content

Commit

Permalink
defining progress_hook in exception case.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Szendrey committed Sep 11, 2024
1 parent fc490c1 commit 7af125b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions service/models/operations/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ def gen_pyciemss_args(self, job_id):
"%s: Failed to connect to RabbitMQ. Unable to log progress", job_id
)

# Log progress hook when unable to connect - for testing purposes.
def progress_hook(current_results):
logging.info(f"Optimize current results: {current_results.tolist()}")

return {
"model_path_or_json": amr_path,
"logging_step_size": self.logging_step_size,
Expand Down

0 comments on commit 7af125b

Please sign in to comment.