ML Inference 🥶
Project description
🏖️ Nbox
nbox
is NimbleBox.ai's official SDK.
The entire purpose of this package is to make using ML 🥶.
pip install nbox
🔥 Usage
nbox
provides first class support API for all NimbleBox.ai infrastructure (NBX-Build, Jobs, Deploy) and services (NBX-Workspaces) components. Write jobs using nbox.Operators
:
from nbox import Operator
from nbox.nbxlib.ops import Magic
# define a class object
weekly_trainer: Operator = Magic()
# call your operators
weekly_trainer(
pass_values = "directly",
)
# confident? deploy it to your cloud
weekly_trainer.deploy(
job_id_or_name = "magic_jobs",
schedule = Schedule(4, 30, ['fri']) # schedule like humans
)
Deploy your machine learning or statistical models:
from nbox import Model
from transformers import AutoModelForSequenceClassification, AutoTokenizer
# define your pre and post processing functions
def pre(x: Dict):
return AutoTokenizer(**x)
# load your classifier with functions
model = AutoModelForSequenceClassification.from_pretrained("distill-bert")
classifier = Model(model, pre = pre)
# call your model
classifier(f"Is this a good picture?")
# get full control on exporting it
spec = classifier.torch_to_onnx(
TorchToOnnx(...)
)
# confident? deploy it your cloud
url, key = classifier.deploy(
spec, deployment_id_or_name = "classification"
)
# use it anywhere
pred = requests.post(
url,
json = {
"text": f"Is this a good picture?"
},
header = {"Authorization": f"Bearer {key}"}
).json()
🧩 License
The code in thist repo is licensed as Apache License 2.0. Please check for individual repositories for licenses.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nimblebox-0.9.16.tar.gz
(115.8 kB
view details)
Built Distribution
nimblebox-0.9.16-py3-none-any.whl
(128.8 kB
view details)
File details
Details for the file nimblebox-0.9.16.tar.gz
.
File metadata
- Download URL: nimblebox-0.9.16.tar.gz
- Upload date:
- Size: 115.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.12 Darwin/21.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 516b5d3fc59ceae84df19f8644d6a488006bbb109aaeeeeaa9eeeded90fb47fc |
|
MD5 | 2ace5da298502bb5b9e91d2431e52346 |
|
BLAKE2b-256 | 6efe0b3eb793b21961d45f87c3ca63710d7b278aae484ed08bc48107dbd1e356 |
File details
Details for the file nimblebox-0.9.16-py3-none-any.whl
.
File metadata
- Download URL: nimblebox-0.9.16-py3-none-any.whl
- Upload date:
- Size: 128.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.12 Darwin/21.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fe249a3be39f4a0e8743fe28b64d539ebe178afb496398cac7016c0ba57faa8 |
|
MD5 | 0fe7b6729692057627d7d9d1b385e852 |
|
BLAKE2b-256 | 7b5db96661f6d3546f1d15b3de281ec08d570127295f55ac55b923cbef208f2f |