damccorm commented on code in PR #40906:
URL: https://github.com/apache/beam/pull/40906#discussion_r4484081168


##########
sdks/python/apache_beam/ml/inference/base.py:
##########
@@ -2299,6 +2330,7 @@ def get_metrics_collector(self, prefix: str = ''):
   def setup(self):
     self._metrics_collector = self.get_metrics_collector()
     self._model_handler.set_environment_vars()
+    self._model_handler.set_model_identifier(self._model_tag)

Review Comment:
   > I kept the call in setup() as well, since the construction-time call 
mutates the user's handler: if one handler instance is shared across 
RunInferences with different identifiers, the worker still re-sets the right 
value from the DoFn's own _model_tag.
   
   Oh interesting, I hadn't thought about this modifying the original 
underlying model handler in that case. Given that, lets just keep this set call 
instead of having it in both places. Sorry for the churn



-- 
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]

Reply via email to