Pre-release
This release is a pre-release and may not be stable for production use.
🏖️ 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.
Release files for nbox 0.9.14rc10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nbox-0.9.14rc10.tar.gz | 111.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nbox-0.9.14rc10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 233.0 kB
Release files / nbox-0.9.14rc10.tar.gz
| Download URL | nbox-0.9.14rc10.tar.gz |
|---|---|
| Size | 111.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
982a0c5a3f94c1b412a0d7da4c2b8e1bcc8b42e513ad6b1dce9d50979075cad0
|
|
BLAKE2b-256 checksum How to use checksums |
b8ce1904c498918c2d41c02f85fd925ea0a919682884f6cb5c957b4522c25f63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.12 Darwin/21.1.0
|
Release files / nbox-0.9.14rc10-py3-none-any.whl
| Download URL | nbox-0.9.14rc10-py3-none-any.whl |
|---|---|
| Size | 122.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
042491f34c4d038664a6e12ba43ae5ace1969f1336e2a3b7afc3fadaf1d3b692
|
|
BLAKE2b-256 checksum How to use checksums |
28a525c125595adbe333ebff4fedc01c4a63a13bc2b4f59c1a95fab56bc48154
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.12 Darwin/21.1.0
|