AnandInguva commented on code in PR #25200:
URL: https://github.com/apache/beam/pull/25200#discussion_r1089136493
##########
sdks/python/apache_beam/ml/inference/base.py:
##########
@@ -444,6 +528,28 @@ def process(self, batch, inference_args):
return predictions
+ def process(
+ self, batch, inference_args, si_model_metadata: Optional[ModelMetdata]):
+ """
+ When side input is enabled:
+ The method checks if the side input model has been updated, and if so,
+ updates the model and runs inference on the batch of data. If the
+ side input is empty or the model has not been updated, the method
+ simply runs inference on the batch of data.
+ """
+ if si_model_metadata and self._enable_side_input_loading:
Review Comment:
Yes, I want to use if `self._enable_side_input_loading` but mypy type
checker is throwing errors since it interprets `si_model_metadata` as
`Optional[ModelMetadata]`. So If I include `si_model_metadata`, the mypy errors
goes off.
We can just to if si_model_metadata as well. Let me see.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]