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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nbox-0.9.7rc2.tar.gz.
File metadata
- Download URL: nbox-0.9.7rc2.tar.gz
- Upload date:
- Size: 113.6 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 |
69807bb45a254b5557c777af4eaeac9d52ad34786b73589b9868d613c55f2227
|
|
| MD5 |
9512c68fe682664f265f5742eb542d6f
|
|
| BLAKE2b-256 |
12bb287aa4f8589d1c221d5c4e9ca7051593d16ec825b1eb8af93b9f82004fd6
|
File details
Details for the file nbox-0.9.7rc2-py3-none-any.whl.
File metadata
- Download URL: nbox-0.9.7rc2-py3-none-any.whl
- Upload date:
- Size: 116.9 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 |
ba7968fbf1bf929c729222c050a8907367bd2818079b5eae56d70aa69853e1f9
|
|
| MD5 |
d2b59bd767128ed4d24d05aa41498fe0
|
|
| BLAKE2b-256 |
f0e400378299df1e194c2ba781c0ceb6c18956ede39542e1d58b905e8b817cec
|