blobhub.model.onnx, and each revision of it holds one model.
How BlobHub works covers blobs, revisions and the type behind them.
Uploading a model
A model travels as an archive,model.tar.gz, holding a single file named model.onnx. An archive of up to 4 MiB
goes in the body of one upload request. A larger one goes
in parts: the platform hands back a presigned URL for each 10 MiB part, you send
the parts straight to storage, and one more call completes the upload.
Either way, the call returns an operation id instead of waiting. The platform unpacks the archive in the background,
and you poll the operation until it is completed, or failed when the archive does not hold a model that parses as
ONNX.
Uploads go to a draft revision, and committing the draft freezes its model. A new revision starts with a copy of the
stored model, so a retrained model is uploaded to the new draft while the committed revision keeps the old one.
Topology
Once the archive is in, the platform extracts the model file and parses its graph into a JSON topology: the nodes, inputs, outputs and initializers ONNX defines, without the coefficients. It is the model’s shape without its weights, and it is how you look at a large model without fetching it. A revision therefore holds the model in three forms, each fetched on its own: the archive as uploaded (model.tar.gz), the extracted model file (model.onnx) and the topology (model.json).
Downloading
download returns one artifact’s bytes inline, in the response. An artifact larger
than 4 MiB comes in ranged parts over presigned URLs instead. describe lists the
three artifacts by name and size without fetching any of them, so you know which way to fetch one before you start.
From Python
The Python SDK’sonnx module does all of this in a call each. upload() packs a .onnx file,
sends it in one request or in parts by its size, and waits on the operation. download() fetches the extracted
model and caches it for a committed revision. topology() returns the parsed graph.
blobhub package: three
download those models and run them on your machine with ONNX Runtime, and the fourth exports a model with PyTorch
and uploads it to a blob of yours.
