Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Task]: Update RunInference Notebooks to use Custom Inference Functions #24334

Open
jrmccluskey opened this issue Nov 23, 2022 · 7 comments
Open

Comments

@jrmccluskey
Copy link
Contributor

What needs to happen?

Once Beam 2.44 is released, the RunInference example notebooks should be updated to take advantage of the custom inference function capabilities added in #22572

Issue Priority

Priority: 2

Issue Component

Component: run-inference

@ziqi-ma
Copy link
Contributor

ziqi-ma commented Dec 27, 2022

Would it be better to just add one more notebook using Huggingface generate rather than modifying the existing examples (since the existing ones don't really require calling a non-default inference function)?

@smeet07
Copy link
Contributor

smeet07 commented Apr 24, 2023

@jrmccluskey @damccorm I would like to contribute to this issue , I have one question though. What is the name of the convenience function that was agreed upon in #24062

@damccorm
Copy link
Contributor

It depends on the model handler, but for PyTorchTensor its make_tensor_model_fn -

def make_tensor_model_fn(model_fn: str) -> TensorInferenceFn:

Roughly they should all follow the make_<something>_fn pattern

@damccorm
Copy link
Contributor

@smeet07
Copy link
Contributor

smeet07 commented Jul 3, 2023

@damccorm what model should I use for the example?

@damccorm
Copy link
Contributor

damccorm commented Jul 5, 2023

Hey @smeet07 we shouldn't need to use a new model, we just need to get rid of HuggingFaceStripBatchingWrapper from https://github.com/apache/beam/blob/master/examples/notebooks/beam-ml/run_inference_pytorch_tensorflow_sklearn.ipynb and use a custom inference function instead

@smeet07
Copy link
Contributor

smeet07 commented Jul 5, 2023

Alright

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants