tvalentyn commented on code in PR #31052:
URL: https://github.com/apache/beam/pull/31052#discussion_r1576728785
##########
sdks/python/apache_beam/ml/inference/base.py:
##########
@@ -1416,8 +1498,10 @@ def load():
if isinstance(side_input_model_path, str):
self._model_handler.update_model_path(side_input_model_path)
else:
- self._model_handler.update_model_paths(
- self._model, side_input_model_path)
+ if self._model is not None:
Review Comment:
How about we:
1) create a _ModelWrapper base class, that is used for a single model
single process scenario
2) _CrossProcessModelWrapper that also supports multiple models that are
shared across the process.
3) Implement `_ModelWrapper._update_model_path(mh, new_model_path_config)`
in both classes inside using the appropriate logic.
that should push some the complexity associated with # of models and the
difference between update_model_path vs update_model_paths away from load().
--
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]