Instructions to use dizyann/crivo-web with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use dizyann/crivo-web with Transformers.js:
// ⚠️ Unknown pipeline tag
Consolidate Crivo 17m assets from dizyann/crivo-17m-web@94d23306
Browse files- models/17m/README.md +31 -0
- models/17m/config.json +125 -0
- models/17m/onnx/model.onnx +3 -0
- models/17m/onnx/model_quantized.onnx +3 -0
- models/17m/parity.json +147 -0
- models/17m/tokenizer.json +0 -0
- models/17m/tokenizer_config.json +24 -0
models/17m/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
base_model: tardellirs/crivo-17m
|
| 4 |
+
library_name: transformers.js
|
| 5 |
+
tags: [onnx, modernbert, quantized, int8, wasm, webgpu]
|
| 6 |
+
---
|
| 7 |
+
# Crivo 17M Web
|
| 8 |
+
|
| 9 |
+
Web compatibility by [Yann Cabral (dizyann)](https://huggingface.co/dizyann).
|
| 10 |
+
Original architecture, training and weights by [tardellirs](https://huggingface.co/tardellirs/crivo-17m).
|
| 11 |
+
No additional training was performed. Weights retain the CC BY-NC 4.0 license.
|
| 12 |
+
|
| 13 |
+
[Playground](https://huggingface.co/spaces/dizyann/crivo-demo) ·
|
| 14 |
+
[TypeScript library, CLI and model comparison](https://huggingface.co/dizyann/crivo-150m-web)
|
| 15 |
+
|
| 16 |
+
Source revision: `2b97905e8d35b0afbbdfa63d6dfc92d6c3450c25`.
|
| 17 |
+
See the [pinned original card](https://huggingface.co/tardellirs/crivo-17m/blob/2b97905e8d35b0afbbdfa63d6dfc92d6c3450c25/README.md)
|
| 18 |
+
for upstream benchmarks, training data and limitations. Those benchmarks do not measure this conversion.
|
| 19 |
+
|
| 20 |
+
Includes the complete encoder, question-type embedding and option scorer in FP32
|
| 21 |
+
and per-channel INT8 weight storage with FP32 arithmetic, ONNX opset 17. Native CPU supports both; WebGPU requires FP32. Browser CPU supports INT8 for every size;
|
| 22 |
+
1B FP32 is disabled on WASM after a memory-allocation failure.
|
| 23 |
+
INT8 reduces download size; it does not promise lower runtime memory or faster inference.
|
| 24 |
+
The wrapper caps inputs at 7,999 tokens. Large models require substantial runtime memory.
|
| 25 |
+
|
| 26 |
+
FP32 maximum logit error against PyTorch on the three bundled fixtures:
|
| 27 |
+
`8.940696716308594e-06`. INT8 maximum probability difference from FP32:
|
| 28 |
+
`0.02699467312883752`. These small numerical checks are not an accuracy
|
| 29 |
+
benchmark; recalibrate thresholds on your own inputs and compare equivalent batches.
|
| 30 |
+
See `parity.json` for fixtures, versions and provenance. Use the project lockfile:
|
| 31 |
+
older native ONNX Runtime versions can produce materially different INT8 probabilities.
|
models/17m/config.json
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"transformers_version": "5.19.0",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"PreTrainedModel"
|
| 5 |
+
],
|
| 6 |
+
"output_hidden_states": false,
|
| 7 |
+
"return_dict": true,
|
| 8 |
+
"dtype": "float32",
|
| 9 |
+
"chunk_size_feed_forward": 0,
|
| 10 |
+
"is_encoder_decoder": false,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "LABEL_0"
|
| 13 |
+
},
|
| 14 |
+
"label2id": {
|
| 15 |
+
"LABEL_0": 0
|
| 16 |
+
},
|
| 17 |
+
"problem_type": null,
|
| 18 |
+
"vocab_size": 50369,
|
| 19 |
+
"hidden_size": 256,
|
| 20 |
+
"intermediate_size": 384,
|
| 21 |
+
"num_hidden_layers": 7,
|
| 22 |
+
"num_attention_heads": 4,
|
| 23 |
+
"hidden_activation": "gelu",
|
| 24 |
+
"max_position_embeddings": 7999,
|
| 25 |
+
"initializer_range": 0.02,
|
| 26 |
+
"initializer_cutoff_factor": 2.0,
|
| 27 |
+
"norm_eps": 1e-05,
|
| 28 |
+
"norm_bias": false,
|
| 29 |
+
"pad_token_id": 50283,
|
| 30 |
+
"eos_token_id": null,
|
| 31 |
+
"bos_token_id": null,
|
| 32 |
+
"cls_token_id": 50281,
|
| 33 |
+
"sep_token_id": 50282,
|
| 34 |
+
"attention_bias": false,
|
| 35 |
+
"attention_dropout": 0.0,
|
| 36 |
+
"layer_types": [
|
| 37 |
+
"full_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"sliding_attention",
|
| 43 |
+
"full_attention"
|
| 44 |
+
],
|
| 45 |
+
"rope_parameters": {
|
| 46 |
+
"full_attention": {
|
| 47 |
+
"rope_theta": 160000.0,
|
| 48 |
+
"rope_type": "default"
|
| 49 |
+
},
|
| 50 |
+
"sliding_attention": {
|
| 51 |
+
"rope_theta": 160000.0,
|
| 52 |
+
"rope_type": "default"
|
| 53 |
+
}
|
| 54 |
+
},
|
| 55 |
+
"local_attention": 128,
|
| 56 |
+
"embedding_dropout": 0.0,
|
| 57 |
+
"mlp_bias": false,
|
| 58 |
+
"mlp_dropout": 0.0,
|
| 59 |
+
"decoder_bias": true,
|
| 60 |
+
"classifier_pooling": "mean",
|
| 61 |
+
"classifier_dropout": 0.0,
|
| 62 |
+
"classifier_bias": false,
|
| 63 |
+
"classifier_activation": "gelu",
|
| 64 |
+
"deterministic_flash_attn": false,
|
| 65 |
+
"sparse_prediction": false,
|
| 66 |
+
"sparse_pred_ignore_index": -100,
|
| 67 |
+
"tie_word_embeddings": true,
|
| 68 |
+
"_name_or_path": "cross-encoder/ettin-reranker-17m-v1",
|
| 69 |
+
"causal_mask": false,
|
| 70 |
+
"global_attn_every_n_layers": 3,
|
| 71 |
+
"gradient_checkpointing": false,
|
| 72 |
+
"is_causal": false,
|
| 73 |
+
"layer_norm_eps": 1e-05,
|
| 74 |
+
"model_type": "custom",
|
| 75 |
+
"position_embedding_type": "sans_pos",
|
| 76 |
+
"output_attentions": false,
|
| 77 |
+
"decision": {
|
| 78 |
+
"opt_token": "[OPT]",
|
| 79 |
+
"opt_token_id": 50368,
|
| 80 |
+
"question_types": {
|
| 81 |
+
"noul": 0,
|
| 82 |
+
"choice": 1,
|
| 83 |
+
"score": 2
|
| 84 |
+
},
|
| 85 |
+
"base": "cross-encoder/ettin-reranker-17m-v1",
|
| 86 |
+
"step": 3287,
|
| 87 |
+
"args": {
|
| 88 |
+
"base": "cross-encoder/ettin-reranker-17m-v1",
|
| 89 |
+
"train": "../data/mix400_s3.train.jsonl.gz",
|
| 90 |
+
"dev": "../data/mix400_s3.dev.jsonl.gz",
|
| 91 |
+
"out": "../runs/c17cs3",
|
| 92 |
+
"epochs": 1.0,
|
| 93 |
+
"lr": 4e-05,
|
| 94 |
+
"head_lr": 0.0002,
|
| 95 |
+
"wd": 0.01,
|
| 96 |
+
"warmup": 0.03,
|
| 97 |
+
"max_len": 8192,
|
| 98 |
+
"max_tokens": 24576,
|
| 99 |
+
"max_items": 64,
|
| 100 |
+
"brier": 0.5,
|
| 101 |
+
"eval_every": 100000,
|
| 102 |
+
"save_every": 0,
|
| 103 |
+
"seed": 0,
|
| 104 |
+
"attn": "sdpa",
|
| 105 |
+
"workers": 12,
|
| 106 |
+
"limit": 0,
|
| 107 |
+
"init": "../runs/c17cs2",
|
| 108 |
+
"teacher": null,
|
| 109 |
+
"kd_alpha": 0.5,
|
| 110 |
+
"kd_tau_multi": 2.0,
|
| 111 |
+
"kd_tau_bin": 1.0,
|
| 112 |
+
"kd_gold_only": "t1/,extra/home,bekko/bpomp",
|
| 113 |
+
"ema": 0.0,
|
| 114 |
+
"grad_accum": 1,
|
| 115 |
+
"grad_ckpt": false,
|
| 116 |
+
"skip_oom": true,
|
| 117 |
+
"save_at": []
|
| 118 |
+
}
|
| 119 |
+
},
|
| 120 |
+
"source": {
|
| 121 |
+
"repo": "tardellirs/crivo-17m",
|
| 122 |
+
"revision": "2b97905e8d35b0afbbdfa63d6dfc92d6c3450c25"
|
| 123 |
+
},
|
| 124 |
+
"web_max_length": 7999
|
| 125 |
+
}
|
models/17m/onnx/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a5be4897088b792387909ec3d02dc3a20f903f1a4ef569c52a4dec0f444ce155
|
| 3 |
+
size 67634180
|
models/17m/onnx/model_quantized.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:70c511a138a493a5ae54366607938ed63ac1485535538c2a44cc627356c100b9
|
| 3 |
+
size 17385364
|
models/17m/parity.json
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"source": {
|
| 3 |
+
"repo": "tardellirs/crivo-17m",
|
| 4 |
+
"revision": "2b97905e8d35b0afbbdfa63d6dfc92d6c3450c25"
|
| 5 |
+
},
|
| 6 |
+
"fp32_max_logit_error": 8.940696716308594e-06,
|
| 7 |
+
"int8_max_probability_error": 0.02699467312883752,
|
| 8 |
+
"cases": [
|
| 9 |
+
{
|
| 10 |
+
"state": "Please refund my duplicate payment.",
|
| 11 |
+
"questions": [
|
| 12 |
+
{
|
| 13 |
+
"type": "choice",
|
| 14 |
+
"instructions": "Identify the intent.",
|
| 15 |
+
"criteria": {
|
| 16 |
+
"refund": "Return money",
|
| 17 |
+
"cancel": "Cancel order",
|
| 18 |
+
"other": "Another request"
|
| 19 |
+
}
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
"type": "noul",
|
| 23 |
+
"instructions": "The customer was charged twice."
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "score",
|
| 27 |
+
"instructions": "Rate urgency.",
|
| 28 |
+
"criteria": [
|
| 29 |
+
"Low",
|
| 30 |
+
"Medium",
|
| 31 |
+
"High"
|
| 32 |
+
]
|
| 33 |
+
}
|
| 34 |
+
],
|
| 35 |
+
"fp32": [
|
| 36 |
+
[
|
| 37 |
+
0.6228481883537471,
|
| 38 |
+
0.20584572566090895,
|
| 39 |
+
0.171306085985344
|
| 40 |
+
],
|
| 41 |
+
[
|
| 42 |
+
0.7194906058277007,
|
| 43 |
+
0.2805093941722992,
|
| 44 |
+
0.0
|
| 45 |
+
],
|
| 46 |
+
[
|
| 47 |
+
0.49355561984045077,
|
| 48 |
+
0.30681019469626913,
|
| 49 |
+
0.1996341854632801
|
| 50 |
+
]
|
| 51 |
+
],
|
| 52 |
+
"int8": [
|
| 53 |
+
[
|
| 54 |
+
0.6211563914556442,
|
| 55 |
+
0.20283554615959642,
|
| 56 |
+
0.17600806238475933
|
| 57 |
+
],
|
| 58 |
+
[
|
| 59 |
+
0.738553814749977,
|
| 60 |
+
0.261446185250023,
|
| 61 |
+
0.0
|
| 62 |
+
],
|
| 63 |
+
[
|
| 64 |
+
0.4950126058820628,
|
| 65 |
+
0.315645170763584,
|
| 66 |
+
0.1893422233543532
|
| 67 |
+
]
|
| 68 |
+
]
|
| 69 |
+
},
|
| 70 |
+
{
|
| 71 |
+
"state": "The order is fine, I only want to know the delivery date.",
|
| 72 |
+
"questions": [
|
| 73 |
+
{
|
| 74 |
+
"type": "choice",
|
| 75 |
+
"instructions": "Identify intent.",
|
| 76 |
+
"criteria": {
|
| 77 |
+
"question": "Ask a question",
|
| 78 |
+
"refund": "Return money"
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
],
|
| 82 |
+
"fp32": [
|
| 83 |
+
[
|
| 84 |
+
0.8233546329205871,
|
| 85 |
+
0.17664536707941295
|
| 86 |
+
]
|
| 87 |
+
],
|
| 88 |
+
"int8": [
|
| 89 |
+
[
|
| 90 |
+
0.8380087231787934,
|
| 91 |
+
0.16199127682120662
|
| 92 |
+
]
|
| 93 |
+
]
|
| 94 |
+
},
|
| 95 |
+
{
|
| 96 |
+
"state": "A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. A long support request. ",
|
| 97 |
+
"questions": [
|
| 98 |
+
{
|
| 99 |
+
"type": "score",
|
| 100 |
+
"instructions": "Rate urgency.",
|
| 101 |
+
"criteria": [
|
| 102 |
+
"Low",
|
| 103 |
+
"High"
|
| 104 |
+
]
|
| 105 |
+
},
|
| 106 |
+
{
|
| 107 |
+
"type": "noul",
|
| 108 |
+
"instructions": "The service is unavailable.",
|
| 109 |
+
"criteria": {
|
| 110 |
+
"true": "Unavailable",
|
| 111 |
+
"false": "Available"
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
],
|
| 115 |
+
"fp32": [
|
| 116 |
+
[
|
| 117 |
+
0.17116811775127055,
|
| 118 |
+
0.8288318822487294
|
| 119 |
+
],
|
| 120 |
+
[
|
| 121 |
+
0.5830423405555268,
|
| 122 |
+
0.41695765944447327
|
| 123 |
+
]
|
| 124 |
+
],
|
| 125 |
+
"int8": [
|
| 126 |
+
[
|
| 127 |
+
0.14417344462243314,
|
| 128 |
+
0.8558265553775669
|
| 129 |
+
],
|
| 130 |
+
[
|
| 131 |
+
0.6029959460472072,
|
| 132 |
+
0.39700405395279287
|
| 133 |
+
]
|
| 134 |
+
]
|
| 135 |
+
}
|
| 136 |
+
],
|
| 137 |
+
"versions": {
|
| 138 |
+
"torch": "2.14.1",
|
| 139 |
+
"onnx": "1.23.2",
|
| 140 |
+
"onnxruntime": "1.31.0"
|
| 141 |
+
},
|
| 142 |
+
"quantization": {
|
| 143 |
+
"storage": "int8",
|
| 144 |
+
"arithmetic": "fp32",
|
| 145 |
+
"scheme": "symmetric-per-channel-weight-only"
|
| 146 |
+
}
|
| 147 |
+
}
|
models/17m/tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
models/17m/tokenizer_config.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"clean_up_tokenization_spaces": true,
|
| 4 |
+
"cls_token": "[CLS]",
|
| 5 |
+
"extra_special_tokens": [
|
| 6 |
+
"[OPT]"
|
| 7 |
+
],
|
| 8 |
+
"is_local": true,
|
| 9 |
+
"local_files_only": false,
|
| 10 |
+
"mask_token": "[MASK]",
|
| 11 |
+
"max_length": 7999,
|
| 12 |
+
"model_input_names": [
|
| 13 |
+
"input_ids",
|
| 14 |
+
"attention_mask"
|
| 15 |
+
],
|
| 16 |
+
"model_max_length": 7999,
|
| 17 |
+
"pad_token": "[PAD]",
|
| 18 |
+
"sep_token": "[SEP]",
|
| 19 |
+
"stride": 0,
|
| 20 |
+
"tokenizer_class": "PreTrainedTokenizer",
|
| 21 |
+
"truncation_side": "right",
|
| 22 |
+
"truncation_strategy": "longest_first",
|
| 23 |
+
"unk_token": "[UNK]"
|
| 24 |
+
}
|