PY-AI-Dev commited on
Commit
f60cd0a
Β·
verified Β·
1 Parent(s): a4691d8

Add ONNX export for sqlcoder-7b-2

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ model.onnx_data filter=lfs diff=lfs merge=lfs -text
37
+ model_fp16.onnx_data filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ base_model: defog/sqlcoder-7b-2
4
+ base_model_relation: quantized
5
+ library_name: onnx
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - onnx
9
+ - onnxruntime
10
+ - quantized
11
+ quantized_by: liodon-ai
12
+ ---
13
+
14
+ # sqlcoder-7b-2 β€” ONNX
15
+
16
+ ONNX export of [defog/sqlcoder-7b-2](https://huggingface.co/defog/sqlcoder-7b-2), published by [Liodon AI](https://huggingface.co/liodon-ai).
17
+ Exported with [optimum](https://github.com/huggingface/optimum) (`optimum.exporters.onnx.main_export`,
18
+ task `text-generation-with-past`, so the graph exposes past-key-value inputs/outputs for KV-cached
19
+ autoregressive decoding).
20
+
21
+ ## Files
22
+
23
+ | File | Size | Notes |
24
+ |------|------|-------|
25
+ | `model.onnx` | 26.96 GB | FP32, full precision |
26
+ | `model_fp16.onnx` | 14.55 GB | FP16, for GPU execution providers |
27
+
28
+ ## Quick Start
29
+
30
+ ```python
31
+ import onnxruntime as ort
32
+ from transformers import AutoTokenizer
33
+
34
+ tok = AutoTokenizer.from_pretrained("liodon-ai/sqlcoder-7b-2-ONNX")
35
+ sess = ort.InferenceSession("model_quantized.onnx", providers=["CPUExecutionProvider"])
36
+ # past_key_values.*.key / .value inputs must be supplied (zero-length tensors
37
+ # for the first forward pass) -- see optimum's ORTModelForCausalLM for a
38
+ # ready-made wrapper that handles KV-cache bookkeeping automatically:
39
+ # from optimum.onnxruntime import ORTModelForCausalLM
40
+ # model = ORTModelForCausalLM.from_pretrained("liodon-ai/sqlcoder-7b-2-ONNX", file_name="model_quantized.onnx")
41
+ ```
42
+
43
+ ## Source
44
+
45
+ - **Model**: [defog/sqlcoder-7b-2](https://huggingface.co/defog/sqlcoder-7b-2)
46
+ - **License**: other
47
+
48
+ ## Citation
49
+
50
+ ```bibtex
51
+ @misc{liodonai_sqlcoder_7b_2_onnx,
52
+ title = {sqlcoder-7b-2 β€” ONNX},
53
+ author = {{Liodon AI}},
54
+ year = {2026},
55
+ howpublished = {\url{https://huggingface.co/liodon-ai/sqlcoder-7b-2-ONNX}},
56
+ note = {ONNX export of defog/sqlcoder-7b-2}
57
+ }
58
+ ```
59
+
60
+ ---
61
+ *Exported by [Liodon AI](https://huggingface.co/liodon-ai)*
config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "dtype": "float32",
9
+ "eos_token_id": 2,
10
+ "head_dim": 128,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 4096,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 11008,
15
+ "max_position_embeddings": 16384,
16
+ "mlp_bias": false,
17
+ "model_type": "llama",
18
+ "num_attention_heads": 32,
19
+ "num_hidden_layers": 32,
20
+ "num_key_value_heads": 32,
21
+ "pretraining_tp": 1,
22
+ "rms_norm_eps": 1e-05,
23
+ "rope_scaling": null,
24
+ "rope_theta": 1000000,
25
+ "tie_word_embeddings": false,
26
+ "transformers_version": "4.57.6",
27
+ "use_cache": true,
28
+ "vocab_size": 32016
29
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "transformers_version": "4.57.6"
6
+ }
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2862dd7285b835cc4a94c9f6566e1a0bb4926ee06a329fea87d5cc8f33d86845
3
+ size 950975
model.onnx_data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:351b6a28f08e58a6bbf97f50c730552cd38624fa9daf67ed353b04b9a68abd90
3
+ size 26954187008
model_fp16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21cb1ec92d4dbbbca33d1c16a622b0b3b96d2fe052c14209289c4c0c7d3910f5
3
+ size 961796
model_fp16.onnx_data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5029c9897db67b3971b3a2404a1903afd17bb2bad567e49935c9c98110eabe98
3
+ size 14550835456
special_tokens_map.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "▁<PRE>",
4
+ "▁<MID>",
5
+ "▁<SUF>",
6
+ "▁<EOT>",
7
+ "▁<PRE>",
8
+ "▁<MID>",
9
+ "▁<SUF>",
10
+ "▁<EOT>"
11
+ ],
12
+ "bos_token": {
13
+ "content": "<s>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false
18
+ },
19
+ "eos_token": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false
25
+ },
26
+ "unk_token": {
27
+ "content": "<unk>",
28
+ "lstrip": false,
29
+ "normalized": false,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ }
33
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "32007": {
30
+ "content": "▁<PRE>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "32008": {
38
+ "content": "▁<SUF>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "32009": {
46
+ "content": "▁<MID>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "32010": {
54
+ "content": "▁<EOT>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ }
61
+ },
62
+ "additional_special_tokens": [
63
+ "▁<PRE>",
64
+ "▁<MID>",
65
+ "▁<SUF>",
66
+ "▁<EOT>",
67
+ "▁<PRE>",
68
+ "▁<MID>",
69
+ "▁<SUF>",
70
+ "▁<EOT>"
71
+ ],
72
+ "bos_token": "<s>",
73
+ "clean_up_tokenization_spaces": false,
74
+ "eos_token": "</s>",
75
+ "eot_token": "▁<EOT>",
76
+ "extra_special_tokens": {},
77
+ "fill_token": "<FILL_ME>",
78
+ "legacy": null,
79
+ "middle_token": "▁<MID>",
80
+ "model_max_length": 1000000000000000019884624838656,
81
+ "pad_token": null,
82
+ "prefix_token": "▁<PRE>",
83
+ "sp_model_kwargs": {},
84
+ "suffix_token": "▁<SUF>",
85
+ "tokenizer_class": "CodeLlamaTokenizer",
86
+ "unk_token": "<unk>",
87
+ "use_default_system_prompt": false
88
+ }