Starting with the Apache Beam SDK version 2.40, users have access to a RunInference transform.
This transform allows you to make predictions and inference on data with machine learning (ML) models. The model handler abstracts the user from the configuration needed for specific frameworks, such as Tensorflow, PyTorch, and others. For a full list of supported frameworks, see the About Beam ML page.
These notebooks illustrate ways to use Apache Beam's RunInference transforms, as well as different
use cases for ModelHandler
implementations.
Beam comes with multiple ModelHandler
implementations.
- To get started quickly with notebooks, use Colab.
- In Colab, open the notebook from GitHub using the notebook URL, for example:
https://github.com/apache/beam/blob/master/examples/notebooks/beam-ml/run_inference_tensorflow.ipynb
- To run most notebooks, you need to change the Google Cloud project and bucket to your project and bucket.
This section contains the following example notebooks.
- Generate text embeddings by using the Vertex AI API
- Generate text embeddings by using Hugging Face Hub models
- Compute and apply vocabulary on a dataset
- Use MLTransform to scale data
- Preprocessing with the Apache Beam DataFrames API
- Apache Beam RunInference for PyTorch
- Apache Beam RunInference for scikit-learn
- Apache Beam RunInference with TensorFlow
- Use RunInference with a model from TensorFlow Hub
- Apache Beam RunInference with Hugging Face
- Apache Beam RunInference with XGBoost
- Use RunInference with TFX
- Use RunInference with a remotely deployed Vertex AI endpoint
- Use RunInference in Apache Beam
- Use RunInference with a LLM
- Use RunInference with Beam's windowing semantics
- Image processing with Apache Beam
- Natural language processing with Apache Beam
- Speech emotion recognition with Apache Beam