Bilal7Dev commited on
Commit
2b0ffa1
·
verified ·
1 Parent(s): 9cc5cc1

Initial CodeRankEmbed ONNX-int8 export for Grafyx 0.2.0

Browse files
Files changed (8) hide show
  1. LICENSE +23 -0
  2. README.md +17 -0
  3. config.json +53 -0
  4. onnx/model.onnx +3 -0
  5. special_tokens_map.json +37 -0
  6. tokenizer.json +0 -0
  7. tokenizer_config.json +64 -0
  8. vocab.txt +0 -0
LICENSE ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Nomic, Inc.
4
+ Copyright (c) 2024 jalipalo (ONNX conversion)
5
+ Copyright (c) 2025 mrsladoje (INT8 quantization)
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # grafyx-coderankembed-onnx
2
+
3
+ ONNX-int8 mirror of [`nomic-ai/CodeRankEmbed`](https://huggingface.co/nomic-ai/CodeRankEmbed)
4
+ for use with [Grafyx](https://github.com/bilal07karadeniz/Grafyx) via
5
+ [fastembed](https://github.com/qdrant/fastembed).
6
+
7
+ - **Base model:** nomic-ai/CodeRankEmbed (137M params)
8
+ - **Original ONNX-int8 conversion:** [`mrsladoje/CodeRankEmbed-onnx-int8`](https://huggingface.co/mrsladoje/CodeRankEmbed-onnx-int8)
9
+ — re-hosted here to give Grafyx a stable, version-pinned artifact.
10
+ - **License:** MIT (inherits the base model's license)
11
+ - **Format:** ONNX, dynamic int8 quantized
12
+ - **Pooling:** CLS
13
+ - **Normalization:** L2 (cosine-ready)
14
+ - **Embedding dim:** 768
15
+ - **Query prefix (required):** `Represent this query for searching relevant code: `
16
+
17
+ Used by Grafyx's `find_related_code` MCP tool when `GRAFYX_ENCODER=coderankembed`.
config.json ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_function": "swiglu",
3
+ "architectures": [
4
+ "NomicBertModel"
5
+ ],
6
+ "attn_pdrop": 0.0,
7
+ "bos_token_id": null,
8
+ "causal": false,
9
+ "dense_seq_output": true,
10
+ "dtype": "float32",
11
+ "embd_pdrop": 0.1,
12
+ "eos_token_id": null,
13
+ "export_model_type": "transformer",
14
+ "fused_bias_fc": true,
15
+ "fused_dropout_add_ln": true,
16
+ "initializer_range": 0.02,
17
+ "layer_norm_epsilon": 1e-12,
18
+ "max_trained_positions": 2048,
19
+ "mlp_fc1_bias": false,
20
+ "mlp_fc2_bias": false,
21
+ "model_type": "nomic_bert",
22
+ "n_embd": 768,
23
+ "n_head": 12,
24
+ "n_inner": 3072,
25
+ "n_layer": 12,
26
+ "n_positions": 8192,
27
+ "pad_vocab_size_multiple": 64,
28
+ "parallel_block": false,
29
+ "parallel_block_tied_norm": false,
30
+ "prenorm": false,
31
+ "qkv_proj_bias": false,
32
+ "reorder_and_upcast_attn": false,
33
+ "resid_pdrop": 0.1,
34
+ "rotary_emb_base": 1000,
35
+ "rotary_emb_fraction": 1.0,
36
+ "rotary_emb_interleaved": false,
37
+ "rotary_emb_scale_base": null,
38
+ "rotary_scaling_factor": null,
39
+ "scale_attn_by_inverse_layer_idx": false,
40
+ "scale_attn_weights": true,
41
+ "summary_activation": null,
42
+ "summary_first_dropout": 0.1,
43
+ "summary_proj_to_labels": true,
44
+ "summary_type": "cls_index",
45
+ "summary_use_proj": true,
46
+ "transformers_version": "4.57.6",
47
+ "type_vocab_size": 2,
48
+ "use_cache": true,
49
+ "use_flash_attn": true,
50
+ "use_rms_norm": false,
51
+ "use_xentropy": true,
52
+ "vocab_size": 30528
53
+ }
onnx/model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4eae31d09b1843103a1ebd5e2b2e24b5a5cad441a33906b35b12b1e2ed91d1db
3
+ size 138619279
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "additional_special_tokens": [],
45
+ "clean_up_tokenization_spaces": true,
46
+ "cls_token": "[CLS]",
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "max_length": 512,
51
+ "model_max_length": 8192,
52
+ "pad_to_multiple_of": null,
53
+ "pad_token": "[PAD]",
54
+ "pad_token_type_id": 0,
55
+ "padding_side": "right",
56
+ "sep_token": "[SEP]",
57
+ "stride": 0,
58
+ "strip_accents": null,
59
+ "tokenize_chinese_chars": true,
60
+ "tokenizer_class": "BertTokenizer",
61
+ "truncation_side": "right",
62
+ "truncation_strategy": "longest_first",
63
+ "unk_token": "[UNK]"
64
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff