Requirements for using custom components in ML models
Requirements for using custom components with ML models
Last updated: Nov 27, 2024
Requirements for using custom components with ML models
You can define your own transformers, estimators, functions, classes, and tensor operations in models that you deploy in IBM watsonx.ai Runtime as online deployments.
Defining and using custom components
Copy link to section
To use custom components with your models, you need to package your custom components in a Python distribution package.
Package requirements
Copy link to section
The package type must be: source distribution (distributions of type Wheel and Egg are not supported)
The package file format must be: .zip
Any third-party dependencies for your custom components must be installable by pip and must be passed to the install_requires argument of the setup function of the setuptools library.
You must take extra steps when you store your trained model in the watsonx.ai Runtime repository:
Store your custom package in the watsonx.ai Runtime repository (use the
runtimes.store_library function from the watsonx.ai Python client, or the store libraries watsonx.ai Runtime CLI command.)
Create a runtime resource object that references your stored custom package, and then store the runtime resource object in the watsonx.ai Runtime repository (use the runtimes.store function, or the store runtimes command.)
When you store your trained model in the watsonx.ai Runtime repository, reference your stored runtime resource in the metadata that is passed to the store_model function (or the store command.)
About cookies on this siteOur websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising.For more information, please review your cookie preferences options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.