karthik-0306 opened a new pull request, #41393:
URL: https://github.com/apache/beam/pull/41393

   Fixes #41385
   
   `_default_pandas_inference_fn` received `inference_args` but called 
`model.predict(vectorized_batch)` without them, so 
`RunInference(SklearnModelHandlerPandas(...), inference_args={...})` dropped 
them without an error. It now calls `model.predict(vectorized_batch, 
**inference_args)`, as `_default_numpy_inference_fn` already does for 
`SklearnModelHandlerNumpy`.
   
   #41058 also edits `_default_pandas_inference_fn`, in the lines just after 
the `predict` call. The two changes don't overlap in behavior, so whichever 
merges second needs only a small rebase.
   
   Testing:
   - Added `test_predict_pandas_with_inference_args` and 
`test_pipeline_pandas_with_inference_args`, which use a model whose `predict` 
takes a `scale` argument. On master they get `[5, 8, 1, 1, 4]` with 
`inference_args={'scale': 10}`; with the fix they get `[50, 80, 10, 10, 40]`.
   - `sklearn_inference_test.py`: 22 passed, 1 skipped.
   - yapf and ruff are clean on the touched files. CHANGES.md updated.
   
   R: @jrmccluskey
   


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

  • [PR] [RunInference] Pass infer... karthik-0306 (via GitHub) via github

Reply via email to