sohailshk opened a new issue, #41085:
URL: https://github.com/apache/beam/issues/41085
### What happened?
In `HuggingFaceModelHandlerTensor.run_inference`
(`sdks/python/apache_beam/ml/inference/huggingface_inference.py`), the branch
for a custom `inference_fn` calls
```python
self._inference_fn(batch, model, inference_args, inference_args,
self._model_uri)
```
`TensorInferenceFn` is `(batch, model, device, inference_args, model_id)`,
and `HuggingFaceModelHandlerKeyedTensor` passes `self._device` in the same
place, so a custom `inference_fn` receives the `inference_args` dict as
`device`.
Repro: a handler with `device='CPU'` and an `inference_fn` that records its
`device` argument, called with `inference_args={'add': True}`, gets `device ==
{'add': True}`. With `device='GPU'` the model is moved to CUDA, but a custom
function modelled on the default one gets no device string and keeps the inputs
on CPU.
Seen on master (2.79.0.dev).
### Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
### Issue Components
- [X] Component: Python SDK
--
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]