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.14rc20.tar.gz (112.6 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.14rc20-py3-none-any.whl (123.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for nbox-0.9.14rc20.tar.gz
Algorithm Hash digest
SHA256 0d9285db4d3c1af7d4949aac33db57a6c4cbc39776796718422e19d9dee200ea
MD5 3899a8c50cec2ce9f28cb7a8658f6d21
BLAKE2b-256 1d1b5a0547da0d0d8169d47899845d0aea58782b935a7db31745b8e07efa9acd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nbox-0.9.14rc20-py3-none-any.whl
  • Upload date:
  • Size: 123.1 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.14rc20-py3-none-any.whl
Algorithm Hash digest
SHA256 7d585073a662084b3042668253d02fe875fb93ae3c9eae6a46fdb033e016e744
MD5 938faa8e0a33995dea1957f774904206
BLAKE2b-256 19ea97d62582bfcd06be26788fa1ccc3d2e83f669650313dbd0963476686867b

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