damccorm commented on code in PR #29223:
URL: https://github.com/apache/beam/pull/29223#discussion_r1379058409
##########
sdks/python/apache_beam/ml/inference/huggingface_inference.py:
##########
@@ -638,8 +640,36 @@ def __init__(
if max_batch_size is not None:
self._batching_kwargs['max_batch_size'] = max_batch_size
self._large_model = large_model
+
+ # Check if the device is specified twice. If true then the device parameter
+ # of model handler is overridden.
+ self._deduplicate_device_value(device)
_validate_constructor_args_hf_pipeline(self._task, self._model)
+ def _deduplicate_device_value(self, device: str):
Review Comment:
Actually, I'm about to cut and this is still 90 minutes away from being
ready to merge (that's about the runtime of the longest precommit). So this
will have to wait for the next release or for a cherry-pick
--
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]