Model card: run it without a server, in Python or JavaScript

#1
by byamasupatrick - opened

Replaces the PyTorch-only snippet with a Use it section:

  • Python: pip install millid, then MillID.from_pretrained(...), predict and identify_document, plus the millid predict command.
  • JavaScript: @baobabtech/millid, for Node (onnxruntime-node) and browsers (onnxruntime-web).
  • PyTorch: millid.py, labelled as the training code.
  • The ONNX graph: its inputs and outputs.

All of it runs the model in-process from onnx/model.onnx, with no server and no PyTorch.

Everything described here is implemented and tested in https://github.com/baobab-tech/millid/pull/1:

  • Python and JavaScript are tested against the same fixtures: every encoded id equal, and probabilities within 1e-4.
  • Headless Chrome gave the same answers.

Merge after that PR. The install line points at its main branch, so these instructions only work once it is merged.

byamasupatrick changed pull request status to merged

Sign up or log in to comment