From 7a5e6ab895a19ddb1ca038e4cc5a2c298203f60a Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Wed, 3 Jan 2024 23:17:35 -0600 Subject: [PATCH] pass result on to command --- api/onnx_web/worker/command.py | 6 +++--- api/onnx_web/worker/context.py | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/api/onnx_web/worker/command.py b/api/onnx_web/worker/command.py index 03f15068..bc5587a5 100644 --- a/api/onnx_web/worker/command.py +++ b/api/onnx_web/worker/command.py @@ -26,7 +26,7 @@ class ProgressCommand: job: str job_type: str status: JobStatus - results: int + result: Any steps: int stages: int tiles: int @@ -37,7 +37,7 @@ class ProgressCommand: job_type: str, device: str, status: JobStatus, - results: int = 0, + result: Any = None, steps: int = 0, stages: int = 0, tiles: int = 0, @@ -46,7 +46,7 @@ class ProgressCommand: self.job_type = job_type self.device = device self.status = status - self.results = results + self.result = result self.steps = steps self.stages = stages self.tiles = tiles diff --git a/api/onnx_web/worker/context.py b/api/onnx_web/worker/context.py index b3554b12..615a3dda 100644 --- a/api/onnx_web/worker/context.py +++ b/api/onnx_web/worker/context.py @@ -108,7 +108,6 @@ class WorkerContext: step, stages=self.callback.stage, tiles=self.callback.tile, - results=self.callback.results, ) self.callback = ChainProgress.from_progress(on_progress) @@ -123,7 +122,7 @@ class WorkerContext: self.idle.value = idle def set_progress( - self, steps: int, stages: int = 0, tiles: int = 0, results: int = 0 + self, steps: int, stages: int = 0, tiles: int = 0 ) -> None: if self.job is None: raise RuntimeError("no job on which to set progress") @@ -140,7 +139,7 @@ class WorkerContext: steps=steps, stages=stages, tiles=tiles, - results=results, + result=self.callback.result, ) self.progress.put( self.last_progress, @@ -160,7 +159,7 @@ class WorkerContext: steps=self.callback.step, stages=self.callback.stage, tiles=self.callback.tile, - results=self.callback.results, + result=self.callback.result, ) self.progress.put( self.last_progress,