token_scores — sigmoid scores per token (0-1, higher = keep)| File | Description |
|---|---|
model.onnx | Quantized ONNX model (uint8, ~607MB) |
vocab.json | BPE vocabulary (Qwen3 tokenizer) |
merges.txt | BPE merge rules |
metadata.json | Model metadata (token IDs, dimensions) |
crf_params.npz | CRF transition parameters (optional, for Viterbi decoding) |
1import onnxruntime as ort
2import numpy as np
3
4sess = ort.InferenceSession("model.onnx")
5input_ids = np.array([[...]], dtype=np.int64) # [1, seq_len]
6attention_mask = np.array([[...]], dtype=np.int64) # [1, seq_len]
7
8scores = sess.run(None, {"input_ids": input_ids, "attention_mask": attention_mask})[0]
9# scores: [1, seq_len] float32, 0-1 range, higher = keep