Add ONNX variants for PangaiaSoftware-Rosetta2-4B
Browse filesVariants: CPU-INT4, CUDA-INT4, DML-FP16 for 32-language translation
- .gitattributes +41 -35
- README.md +128 -0
- config.json +73 -0
- cpu_and_mobile/cpu-int4-rtn-block-32/chat_template.jinja +22 -0
- cpu_and_mobile/cpu-int4-rtn-block-32/config.json +73 -0
- cpu_and_mobile/cpu-int4-rtn-block-32/genai_config.json +52 -0
- cpu_and_mobile/cpu-int4-rtn-block-32/model.onnx +3 -0
- cpu_and_mobile/cpu-int4-rtn-block-32/model.onnx.data +3 -0
- cpu_and_mobile/cpu-int4-rtn-block-32/special_tokens_map.json +30 -0
- cpu_and_mobile/cpu-int4-rtn-block-32/tokenizer.json +3 -0
- cpu_and_mobile/cpu-int4-rtn-block-32/tokenizer_config.json +0 -0
- cuda/cuda-int4-rtn-block-32/chat_template.jinja +22 -0
- cuda/cuda-int4-rtn-block-32/config.json +73 -0
- cuda/cuda-int4-rtn-block-32/genai_config.json +59 -0
- cuda/cuda-int4-rtn-block-32/model.onnx +3 -0
- cuda/cuda-int4-rtn-block-32/model.onnx.data +3 -0
- cuda/cuda-int4-rtn-block-32/special_tokens_map.json +30 -0
- cuda/cuda-int4-rtn-block-32/tokenizer.json +3 -0
- cuda/cuda-int4-rtn-block-32/tokenizer_config.json +0 -0
- directml/dml-fp16/chat_template.jinja +22 -0
- directml/dml-fp16/config.json +73 -0
- directml/dml-fp16/genai_config.json +57 -0
- directml/dml-fp16/model.onnx +3 -0
- directml/dml-fp16/model.onnx.data +3 -0
- directml/dml-fp16/special_tokens_map.json +30 -0
- directml/dml-fp16/tokenizer.json +3 -0
- directml/dml-fp16/tokenizer_config.json +0 -0
.gitattributes
CHANGED
|
@@ -1,35 +1,41 @@
|
|
| 1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
*.xz 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz 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 |
+
cpu_and_mobile/cpu-int4-rtn-block-32/model.onnx.data filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
cpu_and_mobile/cpu-int4-rtn-block-32/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
cuda/cuda-int4-rtn-block-32/model.onnx.data filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
cuda/cuda-int4-rtn-block-32/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
directml/dml-fp16/model.onnx.data filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
directml/dml-fp16/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: onnx
|
| 3 |
+
pipeline_tag: translation
|
| 4 |
+
language:
|
| 5 |
+
- ar
|
| 6 |
+
- bg
|
| 7 |
+
- zh
|
| 8 |
+
- cs
|
| 9 |
+
- da
|
| 10 |
+
- nl
|
| 11 |
+
- en
|
| 12 |
+
- fi
|
| 13 |
+
- fr
|
| 14 |
+
- de
|
| 15 |
+
- el
|
| 16 |
+
- gu
|
| 17 |
+
- he
|
| 18 |
+
- hi
|
| 19 |
+
- hu
|
| 20 |
+
- id
|
| 21 |
+
- it
|
| 22 |
+
- ja
|
| 23 |
+
- ko
|
| 24 |
+
- fa
|
| 25 |
+
- pl
|
| 26 |
+
- pt
|
| 27 |
+
- ro
|
| 28 |
+
- ru
|
| 29 |
+
- sk
|
| 30 |
+
- es
|
| 31 |
+
- sv
|
| 32 |
+
- tl
|
| 33 |
+
- th
|
| 34 |
+
- tr
|
| 35 |
+
- uk
|
| 36 |
+
- vi
|
| 37 |
+
license: gemma
|
| 38 |
+
tags:
|
| 39 |
+
- onnx
|
| 40 |
+
- onnxruntime
|
| 41 |
+
- optimum
|
| 42 |
+
- translation
|
| 43 |
+
- gemma
|
| 44 |
+
- int4
|
| 45 |
+
- quantized
|
| 46 |
+
- cuda
|
| 47 |
+
- directml
|
| 48 |
+
base_model: google/gemma-3-4b-pt
|
| 49 |
+
base_model_relation: quantized
|
| 50 |
+
model-index:
|
| 51 |
+
- name: PangaiaSoftware-Rosetta2-4B-ONNX
|
| 52 |
+
results:
|
| 53 |
+
- task:
|
| 54 |
+
type: translation
|
| 55 |
+
name: Translation
|
| 56 |
+
metrics:
|
| 57 |
+
- type: bleu
|
| 58 |
+
value: 31.5
|
| 59 |
+
name: BLEU Score
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
# PangaiaSoftware-Rosetta-4B-2511-ONNX
|
| 63 |
+
|
| 64 |
+
## Introduction
|
| 65 |
+
This repository hosts Pangaia Software's optimized versions of the [`YanoljaNEXT-Rosetta-4B-2511`](https://huggingface.co/yanolja/YanoljaNEXT-Rosetta-4B-2511) model to accelerate inference with ONNX Runtime.
|
| 66 |
+
|
| 67 |
+
Optimized models are published here in ONNX format to run with ONNX Runtime on CPU and GPU across devices, including server platforms, Windows, Linux and Mac desktops, and mobile CPUs, with the precision best suited to each of these targets.
|
| 68 |
+
|
| 69 |
+
Here are some of the optimized configurations we have added:
|
| 70 |
+
|
| 71 |
+
1. ONNX model for int4 CPU: ONNX model for CPU and mobile using int4 quantization via RTN.
|
| 72 |
+
2. ONNX model for int4 GPU: ONNX model for GPU using fp16 quantization.
|
| 73 |
+
|
| 74 |
+
## Model Run
|
| 75 |
+
For CPU:
|
| 76 |
+
|
| 77 |
+
```bash
|
| 78 |
+
# Download the model directly using the Hugging Face CLI
|
| 79 |
+
huggingface-cli download PangaiaSoftware/PangaiaSoftware-Rosetta2-4B-onnx --include cpu_and_mobile/* --local-dir .
|
| 80 |
+
|
| 81 |
+
# Install the CPU package of ONNX Runtime GenAI
|
| 82 |
+
pip install --pre onnxruntime-genai
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
For CUDA:
|
| 86 |
+
|
| 87 |
+
```bash
|
| 88 |
+
# Download the model directly using the Hugging Face CLI
|
| 89 |
+
huggingface-cli download PangaiaSoftware/PangaiaSoftware-Rosetta2-4B-onnx --include cuda/* --local-dir .
|
| 90 |
+
|
| 91 |
+
# Install the CUDA package of ONNX Runtime GenAI
|
| 92 |
+
pip install --pre onnxruntime-genai-cuda
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
For DirectML:
|
| 96 |
+
|
| 97 |
+
```bash
|
| 98 |
+
# Download the model directly using the Hugging Face CLI
|
| 99 |
+
huggingface-cli download PangaiaSoftware/PangaiaSoftware-Rosetta2-4B-onnx --include directml/* --local-dir .
|
| 100 |
+
|
| 101 |
+
# Install the DML package of ONNX Runtime GenAI
|
| 102 |
+
pip install --pre onnxruntime-genai-directml
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
Execution:
|
| 106 |
+
|
| 107 |
+
Refer to the [`ONNX Runtime GenAI`](https://github.com/microsoft/onnxruntime-genai) repo for the latest samples for model execution.
|
| 108 |
+
|
| 109 |
+
**Note**: since this is a Gemma-based model, use the corresponding prompt template:
|
| 110 |
+
|
| 111 |
+
```
|
| 112 |
+
System = "<start_of_turn>instruction\n{{CONTENT}}<end_of_turn>\n",
|
| 113 |
+
User = "<start_of_turn>source\n{{CONTENT}}<end_of_turn>\n",
|
| 114 |
+
Assistant = "<start_of_turn>translation\n{{CONTENT}}<end_of_turn>\n",
|
| 115 |
+
Stop = ["<end_of_turn>", "<start_of_turn>"]
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
## Model Description
|
| 120 |
+
- Developed by: Pangaia Software
|
| 121 |
+
- Model type: ONNX
|
| 122 |
+
- License: gemma
|
| 123 |
+
- Model Description: This is a conversion of the [`YanoljaNEXT-Rosetta-4B-2511`](https://huggingface.co/yanolja/YanoljaNEXT-Rosetta-4B-2511) model for ONNX Runtime inference, which in turn is based on the [`google/gemma-3-4b-pt`](https://huggingface.co/google/gemma-3-4b-pt) model.
|
| 124 |
+
|
| 125 |
+
**Disclaimer:** Model is only an optimization of the base model, any risk associated with the model is the responsibility of the user of the model. Please verify and test for your scenarios. There may be a slight difference in output from the base model with the optimizations applied.
|
| 126 |
+
|
| 127 |
+
## License
|
| 128 |
+
This model is released under the Gemma license, inherited from its base model, [`google/gemma-3-4b-pt`](https://huggingface.co/google/gemma-3-4b-pt). Please consult the official [Gemma license terms](https://ai.google.dev/gemma/terms) for detailed usage guidelines.
|
config.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_sliding_window_pattern": 6,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"Gemma3ForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"attn_logit_softcapping": null,
|
| 9 |
+
"bos_token_id": 2,
|
| 10 |
+
"cache_implementation": "hybrid",
|
| 11 |
+
"dtype": "bfloat16",
|
| 12 |
+
"eos_token_id": 106,
|
| 13 |
+
"final_logit_softcapping": null,
|
| 14 |
+
"head_dim": 256,
|
| 15 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 16 |
+
"hidden_size": 2560,
|
| 17 |
+
"initializer_range": 0.02,
|
| 18 |
+
"intermediate_size": 10240,
|
| 19 |
+
"layer_types": [
|
| 20 |
+
"sliding_attention",
|
| 21 |
+
"sliding_attention",
|
| 22 |
+
"sliding_attention",
|
| 23 |
+
"sliding_attention",
|
| 24 |
+
"sliding_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"sliding_attention",
|
| 27 |
+
"sliding_attention",
|
| 28 |
+
"sliding_attention",
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"sliding_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"sliding_attention",
|
| 33 |
+
"sliding_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"sliding_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"sliding_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"sliding_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"sliding_attention",
|
| 48 |
+
"sliding_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"sliding_attention",
|
| 51 |
+
"sliding_attention",
|
| 52 |
+
"sliding_attention",
|
| 53 |
+
"sliding_attention"
|
| 54 |
+
],
|
| 55 |
+
"max_position_embeddings": 131072,
|
| 56 |
+
"model_type": "gemma3_text",
|
| 57 |
+
"num_attention_heads": 8,
|
| 58 |
+
"num_hidden_layers": 34,
|
| 59 |
+
"num_key_value_heads": 4,
|
| 60 |
+
"pad_token_id": 0,
|
| 61 |
+
"query_pre_attn_scalar": 256,
|
| 62 |
+
"rms_norm_eps": 1e-06,
|
| 63 |
+
"rope_local_base_freq": 10000.0,
|
| 64 |
+
"rope_scaling": {
|
| 65 |
+
"factor": 8.0,
|
| 66 |
+
"rope_type": "linear"
|
| 67 |
+
},
|
| 68 |
+
"rope_theta": 1000000.0,
|
| 69 |
+
"sliding_window": 1024,
|
| 70 |
+
"transformers_version": "4.56.1",
|
| 71 |
+
"use_cache": false,
|
| 72 |
+
"vocab_size": 262208
|
| 73 |
+
}
|
cpu_and_mobile/cpu-int4-rtn-block-32/chat_template.jinja
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set system_msg = messages | selectattr('role', 'eq', 'system') | list | first | default(none) -%}
|
| 2 |
+
{%- set last_user = messages | selectattr('role', 'eq', 'user') | list | last | default(none) -%}
|
| 3 |
+
{%- set last_assistant = messages | selectattr('role', 'eq', 'assistant') | list | last | default(none) -%}
|
| 4 |
+
|
| 5 |
+
{{- bos_token -}}
|
| 6 |
+
|
| 7 |
+
{%- if system_msg -%}
|
| 8 |
+
<start_of_turn>instruction{{ '\n' }}
|
| 9 |
+
{{- system_msg['content'] | trim -}}<end_of_turn>{{ '\n' }}
|
| 10 |
+
{%- endif -%}
|
| 11 |
+
|
| 12 |
+
{%- if last_user -%}
|
| 13 |
+
<start_of_turn>source{{ '\n' }}
|
| 14 |
+
{{- last_user['content'] | trim -}}<end_of_turn>{{ '\n' }}
|
| 15 |
+
{%- endif -%}
|
| 16 |
+
|
| 17 |
+
{%- if add_generation_prompt -%}
|
| 18 |
+
<start_of_turn>translation{{ '\n' }}
|
| 19 |
+
{%- elif last_assistant -%}
|
| 20 |
+
<start_of_turn>translation{{ '\n' }}
|
| 21 |
+
{{- last_assistant['content'] | trim -}}<end_of_turn>{{ '\n' }}
|
| 22 |
+
{%- endif -%}
|
cpu_and_mobile/cpu-int4-rtn-block-32/config.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_sliding_window_pattern": 6,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"Gemma3ForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"attn_logit_softcapping": null,
|
| 9 |
+
"bos_token_id": 2,
|
| 10 |
+
"cache_implementation": "hybrid",
|
| 11 |
+
"dtype": "bfloat16",
|
| 12 |
+
"eos_token_id": 106,
|
| 13 |
+
"final_logit_softcapping": null,
|
| 14 |
+
"head_dim": 256,
|
| 15 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 16 |
+
"hidden_size": 2560,
|
| 17 |
+
"initializer_range": 0.02,
|
| 18 |
+
"intermediate_size": 10240,
|
| 19 |
+
"layer_types": [
|
| 20 |
+
"sliding_attention",
|
| 21 |
+
"sliding_attention",
|
| 22 |
+
"sliding_attention",
|
| 23 |
+
"sliding_attention",
|
| 24 |
+
"sliding_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"sliding_attention",
|
| 27 |
+
"sliding_attention",
|
| 28 |
+
"sliding_attention",
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"sliding_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"sliding_attention",
|
| 33 |
+
"sliding_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"sliding_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"sliding_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"sliding_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"sliding_attention",
|
| 48 |
+
"sliding_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"sliding_attention",
|
| 51 |
+
"sliding_attention",
|
| 52 |
+
"sliding_attention",
|
| 53 |
+
"sliding_attention"
|
| 54 |
+
],
|
| 55 |
+
"max_position_embeddings": 131072,
|
| 56 |
+
"model_type": "gemma3_text",
|
| 57 |
+
"num_attention_heads": 8,
|
| 58 |
+
"num_hidden_layers": 34,
|
| 59 |
+
"num_key_value_heads": 4,
|
| 60 |
+
"pad_token_id": 0,
|
| 61 |
+
"query_pre_attn_scalar": 256,
|
| 62 |
+
"rms_norm_eps": 1e-06,
|
| 63 |
+
"rope_local_base_freq": 10000.0,
|
| 64 |
+
"rope_scaling": {
|
| 65 |
+
"factor": 8.0,
|
| 66 |
+
"rope_type": "linear"
|
| 67 |
+
},
|
| 68 |
+
"rope_theta": 1000000.0,
|
| 69 |
+
"sliding_window": 1024,
|
| 70 |
+
"transformers_version": "4.56.1",
|
| 71 |
+
"use_cache": false,
|
| 72 |
+
"vocab_size": 262208
|
| 73 |
+
}
|
cpu_and_mobile/cpu-int4-rtn-block-32/genai_config.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": {
|
| 3 |
+
"bos_token_id": 2,
|
| 4 |
+
"context_length": 131072,
|
| 5 |
+
"decoder": {
|
| 6 |
+
"session_options": {
|
| 7 |
+
"log_id": "onnxruntime-genai",
|
| 8 |
+
"provider_options": []
|
| 9 |
+
},
|
| 10 |
+
"filename": "model.onnx",
|
| 11 |
+
"head_size": 256,
|
| 12 |
+
"hidden_size": 2560,
|
| 13 |
+
"inputs": {
|
| 14 |
+
"input_ids": "input_ids",
|
| 15 |
+
"attention_mask": "attention_mask",
|
| 16 |
+
"past_key_names": "past_key_values.%d.key",
|
| 17 |
+
"past_value_names": "past_key_values.%d.value"
|
| 18 |
+
},
|
| 19 |
+
"outputs": {
|
| 20 |
+
"logits": "logits",
|
| 21 |
+
"present_key_names": "present.%d.key",
|
| 22 |
+
"present_value_names": "present.%d.value"
|
| 23 |
+
},
|
| 24 |
+
"num_attention_heads": 8,
|
| 25 |
+
"num_hidden_layers": 34,
|
| 26 |
+
"num_key_value_heads": 4
|
| 27 |
+
},
|
| 28 |
+
"eos_token_id": [
|
| 29 |
+
1,
|
| 30 |
+
106
|
| 31 |
+
],
|
| 32 |
+
"pad_token_id": 0,
|
| 33 |
+
"type": "gemma3_text",
|
| 34 |
+
"vocab_size": 262208
|
| 35 |
+
},
|
| 36 |
+
"search": {
|
| 37 |
+
"diversity_penalty": 0.0,
|
| 38 |
+
"do_sample": true,
|
| 39 |
+
"early_stopping": true,
|
| 40 |
+
"length_penalty": 1.0,
|
| 41 |
+
"max_length": 131072,
|
| 42 |
+
"min_length": 0,
|
| 43 |
+
"no_repeat_ngram_size": 0,
|
| 44 |
+
"num_beams": 1,
|
| 45 |
+
"num_return_sequences": 1,
|
| 46 |
+
"past_present_share_buffer": true,
|
| 47 |
+
"repetition_penalty": 1.0,
|
| 48 |
+
"temperature": 1.0,
|
| 49 |
+
"top_k": 64,
|
| 50 |
+
"top_p": 0.95
|
| 51 |
+
}
|
| 52 |
+
}
|
cpu_and_mobile/cpu-int4-rtn-block-32/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5cc1a93fee23cbfcfce4eb2aba363ec4f478a96ae5ae3108a2f73304a0f7c018
|
| 3 |
+
size 430400
|
cpu_and_mobile/cpu-int4-rtn-block-32/model.onnx.data
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:69450278d7c190a37c2f8a264395aaaaf634baca561153b291b181d00bf3cb33
|
| 3 |
+
size 5379981312
|
cpu_and_mobile/cpu-int4-rtn-block-32/special_tokens_map.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<bos>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "<end_of_turn>",
|
| 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 |
+
"unk_token": {
|
| 24 |
+
"content": "<unk>",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
}
|
| 30 |
+
}
|
cpu_and_mobile/cpu-int4-rtn-block-32/tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a6b7c9043ba3b559295e6032728ca44ba21879713a32d4a35240794b2ed66d78
|
| 3 |
+
size 33384556
|
cpu_and_mobile/cpu-int4-rtn-block-32/tokenizer_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
cuda/cuda-int4-rtn-block-32/chat_template.jinja
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set system_msg = messages | selectattr('role', 'eq', 'system') | list | first | default(none) -%}
|
| 2 |
+
{%- set last_user = messages | selectattr('role', 'eq', 'user') | list | last | default(none) -%}
|
| 3 |
+
{%- set last_assistant = messages | selectattr('role', 'eq', 'assistant') | list | last | default(none) -%}
|
| 4 |
+
|
| 5 |
+
{{- bos_token -}}
|
| 6 |
+
|
| 7 |
+
{%- if system_msg -%}
|
| 8 |
+
<start_of_turn>instruction{{ '\n' }}
|
| 9 |
+
{{- system_msg['content'] | trim -}}<end_of_turn>{{ '\n' }}
|
| 10 |
+
{%- endif -%}
|
| 11 |
+
|
| 12 |
+
{%- if last_user -%}
|
| 13 |
+
<start_of_turn>source{{ '\n' }}
|
| 14 |
+
{{- last_user['content'] | trim -}}<end_of_turn>{{ '\n' }}
|
| 15 |
+
{%- endif -%}
|
| 16 |
+
|
| 17 |
+
{%- if add_generation_prompt -%}
|
| 18 |
+
<start_of_turn>translation{{ '\n' }}
|
| 19 |
+
{%- elif last_assistant -%}
|
| 20 |
+
<start_of_turn>translation{{ '\n' }}
|
| 21 |
+
{{- last_assistant['content'] | trim -}}<end_of_turn>{{ '\n' }}
|
| 22 |
+
{%- endif -%}
|
cuda/cuda-int4-rtn-block-32/config.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_sliding_window_pattern": 6,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"Gemma3ForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"attn_logit_softcapping": null,
|
| 9 |
+
"bos_token_id": 2,
|
| 10 |
+
"cache_implementation": "hybrid",
|
| 11 |
+
"dtype": "bfloat16",
|
| 12 |
+
"eos_token_id": 106,
|
| 13 |
+
"final_logit_softcapping": null,
|
| 14 |
+
"head_dim": 256,
|
| 15 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 16 |
+
"hidden_size": 2560,
|
| 17 |
+
"initializer_range": 0.02,
|
| 18 |
+
"intermediate_size": 10240,
|
| 19 |
+
"layer_types": [
|
| 20 |
+
"sliding_attention",
|
| 21 |
+
"sliding_attention",
|
| 22 |
+
"sliding_attention",
|
| 23 |
+
"sliding_attention",
|
| 24 |
+
"sliding_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"sliding_attention",
|
| 27 |
+
"sliding_attention",
|
| 28 |
+
"sliding_attention",
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"sliding_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"sliding_attention",
|
| 33 |
+
"sliding_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"sliding_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"sliding_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"sliding_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"sliding_attention",
|
| 48 |
+
"sliding_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"sliding_attention",
|
| 51 |
+
"sliding_attention",
|
| 52 |
+
"sliding_attention",
|
| 53 |
+
"sliding_attention"
|
| 54 |
+
],
|
| 55 |
+
"max_position_embeddings": 131072,
|
| 56 |
+
"model_type": "gemma3_text",
|
| 57 |
+
"num_attention_heads": 8,
|
| 58 |
+
"num_hidden_layers": 34,
|
| 59 |
+
"num_key_value_heads": 4,
|
| 60 |
+
"pad_token_id": 0,
|
| 61 |
+
"query_pre_attn_scalar": 256,
|
| 62 |
+
"rms_norm_eps": 1e-06,
|
| 63 |
+
"rope_local_base_freq": 10000.0,
|
| 64 |
+
"rope_scaling": {
|
| 65 |
+
"factor": 8.0,
|
| 66 |
+
"rope_type": "linear"
|
| 67 |
+
},
|
| 68 |
+
"rope_theta": 1000000.0,
|
| 69 |
+
"sliding_window": 1024,
|
| 70 |
+
"transformers_version": "4.56.1",
|
| 71 |
+
"use_cache": false,
|
| 72 |
+
"vocab_size": 262208
|
| 73 |
+
}
|
cuda/cuda-int4-rtn-block-32/genai_config.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": {
|
| 3 |
+
"bos_token_id": 2,
|
| 4 |
+
"context_length": 131072,
|
| 5 |
+
"decoder": {
|
| 6 |
+
"session_options": {
|
| 7 |
+
"log_id": "onnxruntime-genai",
|
| 8 |
+
"provider_options": [
|
| 9 |
+
{
|
| 10 |
+
"cuda": {
|
| 11 |
+
"enable_cuda_graph": "0",
|
| 12 |
+
"enable_skip_layer_norm_strict_mode": "1"
|
| 13 |
+
}
|
| 14 |
+
}
|
| 15 |
+
]
|
| 16 |
+
},
|
| 17 |
+
"filename": "model.onnx",
|
| 18 |
+
"head_size": 256,
|
| 19 |
+
"hidden_size": 2560,
|
| 20 |
+
"inputs": {
|
| 21 |
+
"input_ids": "input_ids",
|
| 22 |
+
"attention_mask": "attention_mask",
|
| 23 |
+
"past_key_names": "past_key_values.%d.key",
|
| 24 |
+
"past_value_names": "past_key_values.%d.value"
|
| 25 |
+
},
|
| 26 |
+
"outputs": {
|
| 27 |
+
"logits": "logits",
|
| 28 |
+
"present_key_names": "present.%d.key",
|
| 29 |
+
"present_value_names": "present.%d.value"
|
| 30 |
+
},
|
| 31 |
+
"num_attention_heads": 8,
|
| 32 |
+
"num_hidden_layers": 34,
|
| 33 |
+
"num_key_value_heads": 4
|
| 34 |
+
},
|
| 35 |
+
"eos_token_id": [
|
| 36 |
+
1,
|
| 37 |
+
106
|
| 38 |
+
],
|
| 39 |
+
"pad_token_id": 0,
|
| 40 |
+
"type": "gemma3_text",
|
| 41 |
+
"vocab_size": 262208
|
| 42 |
+
},
|
| 43 |
+
"search": {
|
| 44 |
+
"diversity_penalty": 0.0,
|
| 45 |
+
"do_sample": true,
|
| 46 |
+
"early_stopping": true,
|
| 47 |
+
"length_penalty": 1.0,
|
| 48 |
+
"max_length": 131072,
|
| 49 |
+
"min_length": 0,
|
| 50 |
+
"no_repeat_ngram_size": 0,
|
| 51 |
+
"num_beams": 1,
|
| 52 |
+
"num_return_sequences": 1,
|
| 53 |
+
"past_present_share_buffer": true,
|
| 54 |
+
"repetition_penalty": 1.0,
|
| 55 |
+
"temperature": 1.0,
|
| 56 |
+
"top_k": 64,
|
| 57 |
+
"top_p": 0.95
|
| 58 |
+
}
|
| 59 |
+
}
|
cuda/cuda-int4-rtn-block-32/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7edc6ea8e90e3b14ba998279152f14d6ea36dc94e0873c4d48ff76f1c363eff0
|
| 3 |
+
size 537053
|
cuda/cuda-int4-rtn-block-32/model.onnx.data
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f3a0fdc168acde610b4adb1a5f3131141dbe97ab8c35bb6aed568993e444e83
|
| 3 |
+
size 3660775424
|
cuda/cuda-int4-rtn-block-32/special_tokens_map.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<bos>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "<end_of_turn>",
|
| 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 |
+
"unk_token": {
|
| 24 |
+
"content": "<unk>",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
}
|
| 30 |
+
}
|
cuda/cuda-int4-rtn-block-32/tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a6b7c9043ba3b559295e6032728ca44ba21879713a32d4a35240794b2ed66d78
|
| 3 |
+
size 33384556
|
cuda/cuda-int4-rtn-block-32/tokenizer_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
directml/dml-fp16/chat_template.jinja
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set system_msg = messages | selectattr('role', 'eq', 'system') | list | first | default(none) -%}
|
| 2 |
+
{%- set last_user = messages | selectattr('role', 'eq', 'user') | list | last | default(none) -%}
|
| 3 |
+
{%- set last_assistant = messages | selectattr('role', 'eq', 'assistant') | list | last | default(none) -%}
|
| 4 |
+
|
| 5 |
+
{{- bos_token -}}
|
| 6 |
+
|
| 7 |
+
{%- if system_msg -%}
|
| 8 |
+
<start_of_turn>instruction{{ '\n' }}
|
| 9 |
+
{{- system_msg['content'] | trim -}}<end_of_turn>{{ '\n' }}
|
| 10 |
+
{%- endif -%}
|
| 11 |
+
|
| 12 |
+
{%- if last_user -%}
|
| 13 |
+
<start_of_turn>source{{ '\n' }}
|
| 14 |
+
{{- last_user['content'] | trim -}}<end_of_turn>{{ '\n' }}
|
| 15 |
+
{%- endif -%}
|
| 16 |
+
|
| 17 |
+
{%- if add_generation_prompt -%}
|
| 18 |
+
<start_of_turn>translation{{ '\n' }}
|
| 19 |
+
{%- elif last_assistant -%}
|
| 20 |
+
<start_of_turn>translation{{ '\n' }}
|
| 21 |
+
{{- last_assistant['content'] | trim -}}<end_of_turn>{{ '\n' }}
|
| 22 |
+
{%- endif -%}
|
directml/dml-fp16/config.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_sliding_window_pattern": 6,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"Gemma3ForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"attn_logit_softcapping": null,
|
| 9 |
+
"bos_token_id": 2,
|
| 10 |
+
"cache_implementation": "hybrid",
|
| 11 |
+
"dtype": "bfloat16",
|
| 12 |
+
"eos_token_id": 106,
|
| 13 |
+
"final_logit_softcapping": null,
|
| 14 |
+
"head_dim": 256,
|
| 15 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 16 |
+
"hidden_size": 2560,
|
| 17 |
+
"initializer_range": 0.02,
|
| 18 |
+
"intermediate_size": 10240,
|
| 19 |
+
"layer_types": [
|
| 20 |
+
"sliding_attention",
|
| 21 |
+
"sliding_attention",
|
| 22 |
+
"sliding_attention",
|
| 23 |
+
"sliding_attention",
|
| 24 |
+
"sliding_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"sliding_attention",
|
| 27 |
+
"sliding_attention",
|
| 28 |
+
"sliding_attention",
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"sliding_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"sliding_attention",
|
| 33 |
+
"sliding_attention",
|
| 34 |
+
"sliding_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"sliding_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"sliding_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"sliding_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"sliding_attention",
|
| 48 |
+
"sliding_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"sliding_attention",
|
| 51 |
+
"sliding_attention",
|
| 52 |
+
"sliding_attention",
|
| 53 |
+
"sliding_attention"
|
| 54 |
+
],
|
| 55 |
+
"max_position_embeddings": 131072,
|
| 56 |
+
"model_type": "gemma3_text",
|
| 57 |
+
"num_attention_heads": 8,
|
| 58 |
+
"num_hidden_layers": 34,
|
| 59 |
+
"num_key_value_heads": 4,
|
| 60 |
+
"pad_token_id": 0,
|
| 61 |
+
"query_pre_attn_scalar": 256,
|
| 62 |
+
"rms_norm_eps": 1e-06,
|
| 63 |
+
"rope_local_base_freq": 10000.0,
|
| 64 |
+
"rope_scaling": {
|
| 65 |
+
"factor": 8.0,
|
| 66 |
+
"rope_type": "linear"
|
| 67 |
+
},
|
| 68 |
+
"rope_theta": 1000000.0,
|
| 69 |
+
"sliding_window": 1024,
|
| 70 |
+
"transformers_version": "4.56.1",
|
| 71 |
+
"use_cache": false,
|
| 72 |
+
"vocab_size": 262208
|
| 73 |
+
}
|
directml/dml-fp16/genai_config.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": {
|
| 3 |
+
"bos_token_id": 2,
|
| 4 |
+
"context_length": 131072,
|
| 5 |
+
"decoder": {
|
| 6 |
+
"session_options": {
|
| 7 |
+
"log_id": "onnxruntime-genai",
|
| 8 |
+
"provider_options": [
|
| 9 |
+
{
|
| 10 |
+
"dml": {}
|
| 11 |
+
}
|
| 12 |
+
]
|
| 13 |
+
},
|
| 14 |
+
"filename": "model.onnx",
|
| 15 |
+
"head_size": 256,
|
| 16 |
+
"hidden_size": 2560,
|
| 17 |
+
"inputs": {
|
| 18 |
+
"input_ids": "input_ids",
|
| 19 |
+
"attention_mask": "attention_mask",
|
| 20 |
+
"position_ids": "position_ids",
|
| 21 |
+
"past_key_names": "past_key_values.%d.key",
|
| 22 |
+
"past_value_names": "past_key_values.%d.value"
|
| 23 |
+
},
|
| 24 |
+
"outputs": {
|
| 25 |
+
"logits": "logits",
|
| 26 |
+
"present_key_names": "present.%d.key",
|
| 27 |
+
"present_value_names": "present.%d.value"
|
| 28 |
+
},
|
| 29 |
+
"num_attention_heads": 8,
|
| 30 |
+
"num_hidden_layers": 34,
|
| 31 |
+
"num_key_value_heads": 4
|
| 32 |
+
},
|
| 33 |
+
"eos_token_id": [
|
| 34 |
+
1,
|
| 35 |
+
106
|
| 36 |
+
],
|
| 37 |
+
"pad_token_id": 0,
|
| 38 |
+
"type": "gemma3_text",
|
| 39 |
+
"vocab_size": 262208
|
| 40 |
+
},
|
| 41 |
+
"search": {
|
| 42 |
+
"diversity_penalty": 0.0,
|
| 43 |
+
"do_sample": true,
|
| 44 |
+
"early_stopping": true,
|
| 45 |
+
"length_penalty": 1.0,
|
| 46 |
+
"max_length": 131072,
|
| 47 |
+
"min_length": 0,
|
| 48 |
+
"no_repeat_ngram_size": 0,
|
| 49 |
+
"num_beams": 1,
|
| 50 |
+
"num_return_sequences": 1,
|
| 51 |
+
"past_present_share_buffer": true,
|
| 52 |
+
"repetition_penalty": 1.0,
|
| 53 |
+
"temperature": 1.0,
|
| 54 |
+
"top_k": 64,
|
| 55 |
+
"top_p": 0.95
|
| 56 |
+
}
|
| 57 |
+
}
|
directml/dml-fp16/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:98e279a791a3a08b72fda21a582ae7e0f28ea372c2db08ccaf313a1af9f49322
|
| 3 |
+
size 477903
|
directml/dml-fp16/model.onnx.data
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0d9f429ceb0600cfb3a33998def33d99eadb95ba2a32d45408507b815f41cc88
|
| 3 |
+
size 7895515136
|
directml/dml-fp16/special_tokens_map.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<bos>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "<end_of_turn>",
|
| 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 |
+
"unk_token": {
|
| 24 |
+
"content": "<unk>",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
}
|
| 30 |
+
}
|
directml/dml-fp16/tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a6b7c9043ba3b559295e6032728ca44ba21879713a32d4a35240794b2ed66d78
|
| 3 |
+
size 33384556
|
directml/dml-fp16/tokenizer_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|