ML Inference 🥶
Project description
🧐 What is Nbox?
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
🤷Why NimbleBox
- Write and execute code in Python
- Document your code that supports mathematical equations
- Create/Upload/Share notebooks
- Import notebooks from your local machine
- Import/Publish notebooks from/to GitHub
- Import external datasets (e.g. from Kaggle)
- Integrate PyTorch, TensorFlow, Keras, OpenCV
- Share your projects
- Collaborate with your team
🎚 Features
🏗️ Freedom To Build
🦾 Automate with Ease
🚀 Intuitive Dashboard
🏁 Get Started
Install the package from pipy:
pip install nbox
For convinience you should add nbox to your path by setting up an alias. Throughout the rest of the documentation we will be using nbx as the CLI:
alias nbx="python3 -m nbox"
When loading nbox for the first time, it will prompt you the username and password and create a secrets file at ~/.nbx/secrets.json.
This file then contains all the information that you don’t have to fetch manually again.
APIs
Our APIs are deep, user functions are kept to minimum and most relavant. This documentation contains the full spec of everything, but here’s all the APIs you need to know:
nbox
├── Model # Framework agnostic Model
│ ├── __call__
│ ├── deploy
│ ├── train_on_instance (WIP)
│ └── train_on_jobs (WIP)
├── Operators # How jobs are combinations of operators
│ ├── __call__
│ └── deploy
├── Jobs # For controlling all your jobs
│ ├── logs # stream logs right on your terminal
│ └── trigger # manually trigger a job
└── Instance
├── __call__ # Run any command on the instance
└── mv (WIP) # Move files to and from NBX-Build
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()
🛟 How to get help?
Join our discord and someone from our community or engineering team will respond!
🔖Read our Blog.
🧩 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.