Downloads · 30 days
16
47% of all-time downloads
rcmorano/kev-0.5b-onnx
kev-0.5b-onnx is a text classification model from rcmorano. Use it when you need a label for a piece of text. It is set up for onnx. The card lists the license as apache-2.0.
The kev decision model (Qwen2.5-0.5B backbone + LoRA + pointer readout, prefill-only — it never generates text) exported to a single fp16 ONNX graph that runs in the browser via onnxruntime-web (WebGPU or WASM). Built…
Downloads · 30 days
16
47% of all-time downloads
All-time downloads
34
Public
Repo size
1 GB
Likes
0
Public
Click a slice to open those files.
.onnx989 MB · 97%
From the Hugging Face model README
The kev decision model (Qwen2.5-0.5B backbone + LoRA +
pointer readout, prefill-only — it never generates text) exported to a single fp16 ONNX graph
that runs in the browser via onnxruntime-web (WebGPU or WASM). Built for the Chrome MV3 extension in
this repo's browser/ directory; consumable by any JS/WASM client.
| file | what |
|---|---|
onnx/model_fp16.onnx | merged base+LoRA transformer trunk (~0.99 GB, fp16). No lm_head. |
head.json | PointerHead weights: qw,qb,kw,kb (896→256), scale, d, dp. |
meta.json | special-token roles (state/q/opt/optend/decide), pad_id, length caps. |
config.json | graph input/output spec + provenance (machine-readable). |
tokenizer*, vocab.json, merges.txt, added_tokens.json, special_tokens_map.json | Qwen2.5 tokenizer for transformers.js AutoTokenizer. |
input_ids int64 [B, L]
position_ids int64 [B, L] branch positions restart after the shared state prefix
attention_mask fp16 [B, 1, L, L] CUSTOM additive block-causal mask (see below)
->
last_hidden_state fp16 [B, L, 896]
attention_mask is not the usual 2D padding mask. It encodes the block-causal structure: a token at
segment k (a question branch) attends to the shared state prefix (segment 0) and to its own segment
only; the state prefix attends causally to itself. Allowed = 0x0000, masked = 0xFBFF (−65504, the
fp16 min finite). The client builds it from the packed record; see browser/engine.js (branchMask).
The graph returns hidden states only. The pointer head is applied in JS:
logits[option] = (k(h_opt) · q(h_decide)) * scale # q,k: 896 -> 256
probs = softmax(logits)
at the decide token and each option's closing optend token of every question branch. One forward pass
answers all questions packed against a shared state (the "system one" primitive).
import { AutoTokenizer } from "@huggingface/transformers";
import * as ort from "onnxruntime-web";
const REPO = "https://huggingface.co/<user>/kev-0.5b-web/resolve/main/";
const tok = await AutoTokenizer.from_pretrained("<user>/kev-0.5b-web");
const head = await (await fetch(REPO + "head.json")).then(r => r.json());
const meta = await (await fetch(REPO + "meta.json")).then(r => r.json());
const sess = await ort.InferenceSession.create(REPO + "onnx/model_fp16.onnx",
{ executionProviders: ["webgpu", "wasm"] });
// then: pack record -> encode/branchMask -> sess.run -> readout (see browser/engine.js)
The extension in browser/extension/ loads these same files from its local model/ dir; point it at
this repo to avoid shipping ~1 GB inside the zip.
Qwen/Qwen2.5-0.5B (Apache-2.0).jaredpalmer/kev-0.5b (Apache-2.0), merged into the exported graph.browser/export/export_fp16.py (torch.onnx.export, opset 17, dynamo=False).MODEL_CARD.md for training data, evaluation, and limitations.Apache-2.0 (inherited from the base model and the kev checkpoint).