Skip to main content
Four Jupyter notebooks ship inside the blobhub package, written against this SDK. Three download a public ONNX model and run it with ONNX Runtime, with no account. The fourth exports a model with PyTorch and uploads it to an ONNX blob of yours. blobhub.notebooks lists them and copies one out of the package.

Run one

Open super-resolution.ipynb in JupyterLab, VS Code or any other Jupyter environment, and run it from the top. Its first cell installs what it needs. To run it without opening it:

The notebooks

The three without a credential read the public blobs onnx-text-models/bi-att-flow, onnx-vision-models/super-resolution and onnx-vision-models/object-detection. The two vision notebooks fetch their input photo, and object detection its class labels, from static.blobhub.io. BiDAF’s passages and questions are written in the notebook, and NLTK downloads its tokenizer data. Each notebook’s first cell is its only %pip install:

Public models need no account

The three public notebooks connect with blobhub.connect(anonymous=True). That ignores any profile stored on the machine, so a stale, revoked or foreign profile cannot break them, and no sign-in is needed. Their downloads are cached under ~/.cache/blobhub, so a second run fetches nothing. See Credentials and profiles.

The end-to-end notebook needs your blob

onnx/super-resolution-end-to-end uploads to an ONNX blob you can write to:
  1. Create an ONNX blob on blobhub.io, or pick one you have.
  2. Store a credential that can write to it, with blobhub login or by exporting BLOBHUB_API_KEY. The notebook calls blobhub.connect(), which finds either.
  3. Set ORG and BLOB in the notebook’s “Your blob” cell, each an alias or an id.
When the blob’s default revision is already committed, the notebook creates a new draft to upload to. It never commits that draft; its last cell shows how to, with revision.commit(). It needs PyTorch 2.5 or newer.

From Python

  • blobhub.notebooks.list() returns a Notebook(id, title) for each, in the order above.
  • blobhub.notebooks.copy(notebook_id, dest=".") copies one and returns the new file’s Path. An existing folder, or a string ending in /, receives <last part of the id>.ipynb, and the folder is created if missing. Anything else is the file path to write.
  • copy never overwrites: an existing target raises FileExistsError. An unknown id raises ValueError.

The command line

python -m blobhub.notebooks is the SDK’s only command-line surface. An unknown id exits 2, as does a usage error. A target that exists, or a folder that cannot be written, exits 1. Each error is one error: … line on stderr.

See also