tvalentyn commented on code in PR #21819:
URL: https://github.com/apache/beam/pull/21819#discussion_r895723191


##########
sdks/python/apache_beam/examples/inference/pytorch_image_classification.py:
##########
@@ -114,10 +115,13 @@ def run(argv=None, model_class=None, model_params=None, 
save_main_session=True):
     model_class = MobileNetV2
     model_params = {'num_classes': 1000}
 
-  model_loader = PytorchModelLoader(
-      state_dict_path=known_args.model_state_dict_path,
-      model_class=model_class,
-      model_params=model_params)
+  # the input to RunInference transform is keyed. Wrap

Review Comment:
   This sounds like the input is always keyed. Isn't it user's choice? If so, 
would this be appropriate instead:
   
   ```
   In this example we pass keyed inputs to RunInference transform.
   Therefore, we use KeyedModelHandler wrapper over PytorchModelHandler.
   ```



##########
sdks/python/apache_beam/examples/inference/pytorch_image_classification.py:
##########
@@ -114,10 +115,13 @@ def run(argv=None, model_class=None, model_params=None, 
save_main_session=True):
     model_class = MobileNetV2
     model_params = {'num_classes': 1000}
 
-  model_loader = PytorchModelLoader(
-      state_dict_path=known_args.model_state_dict_path,
-      model_class=model_class,
-      model_params=model_params)
+  # the input to RunInference transform is keyed. Wrap

Review Comment:
   This sounds like the input is always keyed. Isn't it user's choice? If so, 
would this be more appropriate instead:
   
   ```
   In this example we pass keyed inputs to RunInference transform.
   Therefore, we use KeyedModelHandler wrapper over PytorchModelHandler.
   ```



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