Skip to main content

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

nbox-0.9.14rc22.tar.gz (113.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nbox-0.9.14rc22-py3-none-any.whl (124.9 kB view details)

Uploaded Python 3

File details

Details for the file nbox-0.9.14rc22.tar.gz.

File metadata

  • Download URL: nbox-0.9.14rc22.tar.gz
  • Upload date:
  • Size: 113.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

Hashes for nbox-0.9.14rc22.tar.gz
Algorithm Hash digest
SHA256 541c88899b78e285377b35be7700ddafc1153757ab86bab3922d1e697e0b7529
MD5 ddca3f6ef5c9dd0ecfb8a10ef275fafe
BLAKE2b-256 304bd899a71eea6027c0bb5c17cd1a1dc397bb027e56c16d80ad5fa3d7696336

See more details on using hashes here.

File details

Details for the file nbox-0.9.14rc22-py3-none-any.whl.

File metadata

  • Download URL: nbox-0.9.14rc22-py3-none-any.whl
  • Upload date:
  • Size: 124.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

Hashes for nbox-0.9.14rc22-py3-none-any.whl
Algorithm Hash digest
SHA256 d604f3e5347d5931b60a4f4217932d7ae32d7374973a5ebc5733400a5b0d7385
MD5 3245b02c5fba6e139e300e3dc14c72f3
BLAKE2b-256 4a5e680b905b7d250cffcf6f5a896e5cdcaa70eb327c6aed54ce235646bcc842

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page