CoolFace
Modelpublic

ohtaman/jev-gemma-4-E2B-it-choice-64

sourceHugging Faceapache-2.0updated 5d agoView on Hugging Face
0likes32downloads
Model Card

Jev Gemma 4 E2B IT choice 64 (ONNX)

This is a text-only, fixed-label scoring artifact, derived from google/gemma-4-E2B-it via the ONNX Community Transformers.js export. No weights were fine-tuned. The decoder's q4f16 output projection has been restricted to 64 fixed answer tokens, and unused full-vocabulary head bytes have been removed from the decoder data file. The rest of the decoder and the input embedding graph retain the source ONNX weights. It is not a general text generator or a trained task-specific classifier.

Use from JavaScript

This artifact needs the Jev JavaScript scorer, which verifies that each answer label is exactly one token at the current prompt boundary, maps token IDs to the 64 output columns, and compares candidate logits without generating text. It uses Transformers.js 4.3.0 with WebGPU.

js
import {loadJev} from 'jev-browser-classifier';

const jev = await loadJev();
const result = await jev.classify({
  text: '注文した荷物がまだ届いていません。',
  candidates: ['配送', '請求', '技術'],
});
console.log(result.prediction, result.scores);
await jev.dispose();

The model output is [batch, answer_positions, 64]. The output columns follow choice_head_64.json: digits 0–9, uppercase A–Z, lowercase a–z, @, #. The scorer may assign these labels to arbitrary candidate names in a prompt; candidate names are not built into the weights. The runtime checks the token boundary before inference. The logits are compared only among supplied candidates. Softmax over them is a relative score, not a calibrated probability.

Files and provenance

  • —onnx/decoder_model_merged_q4f16.onnx and its external data: Gemma 4 text decoder with a 64-row quantized output projection.
  • —onnx/embed_tokens_q4f16.onnx and its external data: unchanged embedding graph from the source export.
  • —Tokenizer, processor, chat template, and configuration files: copied from the source export.
  • —choice_head_64.json: labels and their original Gemma 4 token IDs.

The source decoder had 1,519,757,824 external-data bytes. The released decoder has 1,286,973,952 bytes after repacking only referenced tensors. The embedding data file is unchanged. The tools/ directory contains the graph conversion and repacking scripts. The original choice manifest preserves the selected Gemma token IDs.

Validation and limits

The 64-label prototype produced exactly the same 18 tested logits as the full-vocabulary q4f16 export for six Japanese JNLI prompts (three candidate labels each). After repacking, the released artifact was loaded in a WebGPU browser and matched all six tested logits on two JNLI prompts exactly. Its ONNX graph and external-data ranges were also validated. This small test does not establish general classification accuracy. Browser speed tests did not show a stable improvement from shrinking the output head, because the full transformer prefill remains. Loading the artifact transfers several GB, and a WebGPU browser is required for the documented JavaScript path.

The original Gemma 4 E2B IT and ONNX export are distributed under Apache 2.0. See the linked upstream model cards for their terms, capabilities, and general safety information.