Run this model with HF Jobs

Run ai-babai/tiny-random-Sam3Model-ONNX on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/ai-babai/tiny-random-Sam3Model-ONNX. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/ai-babai/tiny-random-Sam3Model-ONNX on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
ai-babai's picture
Document the reproducible SAM 3 export
0470b22 verified
|
Raw History Blame Contribute Delete
1.61 kB

Recreate the tiny random SAM 3 fixture

The export script constructs a randomly initialized Sam3Model from Transformers 5.24.1 and seed 1800. It generates its own five-token vocabulary and RGB input. The three FP32 graphs target ONNX opset 18.

Download the script and the pinned dependencies to the same directory. With Python 3.13 in a virtual environment:

python -m pip install -r requirements-export.txt
HF_HUB_OFFLINE=1 python export_tiny_sam3.py ./rebuilt

The command exports the graphs and loader metadata under rebuilt/, and writes expected.json next to that directory. It checks every graph with the ONNX checker and compares all five model outputs for cat and truck against the original Python forward pass using ONNX Runtime CPU. With the listed toolchain on macOS ARM64, two independent runs produced identical SHA-256 digests:

Graph Bytes SHA-256
onnx/vision_encoder.onnx 110306 46a00e57d23b15e012789828924621dddc55a2e2978bfe7785cbbcfb72e68b99
onnx/text_encoder.onnx 32710 817ca92336ea102cff8bc5a927d005393a8ad87c2d9b16ef4caea97bb0ad4d89
onnx/prompt_decoder.onnx 230009 796858207e70df5000ff7a9b599d20b6e4fee6f716e6b8f9d5e8658aaa0778c7

Transformers.js tests can load the fixture from this repository's default branch with dtype: 'fp32'. The fixed input shape is [1, 3, 28, 28], the token sequence has length 32, and the detector returns three queries per image.