mDenseOn, ONNX

lightonai/mDenseOn converted to ONNX, full precision (fp32), so that ONNX Runtime and transformers.js can run it. The weights are unchanged.

The model, its training and its documentation are LightOn's: see the original card for what it is, the languages it covers and how it scores. Licence: Apache-2.0, as the original.

Use

import { pipeline } from "@huggingface/transformers";

const extractor = await pipeline(
  "feature-extraction",
  "diegomo123/mDenseOn-ONNX",
  { dtype: "fp32" },
);
const vectors = await extractor(
  ["query: printer stops mid-batch", "document: The print queue stalls."],
  { pooling: "cls", normalize: true },
);
  • CLS pooling, then unit length, as the original's 1_Pooling/config.json sets it.
  • A query takes the prefix query: and a document document: .
  • A vector has 768 values.

How it was made

From revision a5fdb000f7a21da96c3bddde3a782ef777316df3 of the original:

optimum-cli export onnx --model lightonai/mDenseOn \
  --task feature-extraction --library-name transformers --opset 17 out/

with optimum 2.1.0, optimum-onnx 0.1.0, torch 2.14.1 and transformers 4.57.6. The graph's output is last_hidden_state. On the export's validation input it differs from the PyTorch model by 2.8e-4 at most.

config.json is the export's. tokenizer.json and tokenizer_config.json are the original repository's, unchanged.

sha256 of onnx/model.onnx: 959620931a7976308f37327e36e99dff932bcc2f9dd92e5f7a3a468d523507a1

Downloads last month
261
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for diegomo123/mDenseOn-ONNX

Quantized
(1)
this model