waylay-ml-adapter-sdk
ML Model Adapter plugin for waylay-sdk.
Installation
# installs the ml tool, and the required sdk modules:
pip install waylay-ml-adapter-sdk
# install the adapter module you need:
pip install waylay-ml-adapter-sklearn[dill]
Classes exported by ml_adapter.sdk
The module ml_adapter.sdk exports the following classes
MLTool
ml_adapter.sdk.tool.MLTool
MLAdapter utility service for the waylay client.
Helps creating waylay webscripts and plugs that wrap a machine learning model.
Loaded as tool with name ml_tool in the python sdk.
Example
# create and test a simple model
import numpy as np
test_data = [1,2,3]
expected_result = [2,4,6]
doubler = lambda x: x*2
assert np.array_equal(
np.array(expected_result),
doubler(np.array(test_data))
)
# wrap in an adapter, test remoting
from ml_adapter.numpy import V1NumpyModelAdapter
adapter=V1NumpyModelAdapter(model=doubler)
test_resp == await adapter.call({"instances": test_data.tolist()})
assert test_resp['predictions'] = expected_result.tolist()
# use the ml_tool to deploy and test a webscript
# configure logging to see what is happening
import logging
logging.basicConfig(level='INFO')
from waylay.sdk import WaylayClient
client = WaylayClient.from_profile('demo')
ref = await client.ml_tool.create_webscript(
adapter, name='MyMLWebscript', draft=True
)
ref = await client.ml_tool.wait_until_ready(ref)
result = await client.ml_tool.test_webscript(ref, test_data)
if expected_result.to_list() == result:
await client.ml_tool.publish(ref)
else:
await client.ml_tool.remove(ref)
See also
- waylay-sdk the Waylay python SDK.
- waylay-ml-adapter-sklearn ML adapter for scikit-learn models.
- waylay-ml-adapter-torch ML adapter for pytorch models.
- waylay-ml-adapter-base provides the basic ML adapter infrastructure.
- waylay-ml-adapter-api defines the remote data interfaces.
Metadata
Release files for waylay-ml-adapter-sdk 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| waylay_ml_adapter_sdk-0.1.1.tar.gz | 10.1 kB | Without provenance | Details for waylay_ml_adapter_sdk-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| waylay_ml_adapter_sdk-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for waylay_ml_adapter_sdk-0.1.1-py3-none-any.whl |
Total release size: 20.2 kB
Release files / waylay_ml_adapter_sdk-0.1.1.tar.gz
| Download URL | waylay_ml_adapter_sdk-0.1.1.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71b7b7207051e273bb94dca715eb1021bb46e59f8a26df705fb5fe4f20a1dfb6
|
|
BLAKE2b-256 checksum How to use checksums |
baafb272ddfad602860a53c818ca5e53418fe3e60b218f0cbced28ef9ebf0211
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / waylay_ml_adapter_sdk-0.1.1-py3-none-any.whl
| Download URL | waylay_ml_adapter_sdk-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
073d5fdc0b5e65b7a99e861beaf3e4670cd5deb43535d4d9280f43fee87b6b2d
|
|
BLAKE2b-256 checksum How to use checksums |
55c86a78e14fea8d6ec30d1fd706e79bfe268ea65d1cb7fb04b04ba30ccbf2e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Security for waylay-ml-adapter-sdk 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.