@@ -229,9 +229,9 @@ def __call__(self, *args, **kwargs) -> BaseModel:
229
229
# batch size of the inputs may be `> self._batch_size` at this point
230
230
engine_inputs : List [numpy .ndarray ] = self .process_inputs (pipeline_inputs )
231
231
if isinstance (engine_inputs , tuple ):
232
- engine_inputs , postprocess_kwargs = engine_inputs
232
+ engine_inputs , context = engine_inputs
233
233
else :
234
- postprocess_kwargs = {}
234
+ context = {}
235
235
236
236
timer .stop (InferenceStages .PRE_PROCESS )
237
237
self .log (
@@ -248,9 +248,7 @@ def __call__(self, *args, **kwargs) -> BaseModel:
248
248
)
249
249
250
250
# submit split batches to engine threadpool
251
- engine_forward_with_context = partial (
252
- self .engine_forward , context = postprocess_kwargs
253
- )
251
+ engine_forward_with_context = partial (self .engine_forward , context = context )
254
252
batch_outputs = list (
255
253
self .executor .map (engine_forward_with_context , batches )
256
254
)
@@ -276,9 +274,7 @@ def __call__(self, *args, **kwargs) -> BaseModel:
276
274
277
275
# ------ POSTPROCESSING ------
278
276
timer .start (InferenceStages .POST_PROCESS )
279
- pipeline_outputs = self .process_engine_outputs (
280
- engine_outputs , ** postprocess_kwargs
281
- )
277
+ pipeline_outputs = self .process_engine_outputs (engine_outputs , ** context )
282
278
if not isinstance (pipeline_outputs , self .output_schema ):
283
279
raise ValueError (
284
280
f"Outputs of { self .__class__ } must be instances of "
0 commit comments