初始化项目,由ModelHub XC社区提供模型

Model: Multilingual-Multimodal-NLP/IndustrialCoder-Base
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-05-09 01:23:08 +08:00
commit a36924575f
23 changed files with 2933 additions and 0 deletions

35
.gitattributes vendored Normal file
View File

@@ -0,0 +1,35 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text

194
README.md Normal file
View File

@@ -0,0 +1,194 @@
---
license: apache-2.0
library_name: transformers
pipeline_tag: text-generation
tags:
- code
- industrial-code
- pretrained
- base-model
- verilog
- cuda
- triton
- chip-design
- cad
---
# InCoder-32B-Base: Code Foundation Model for Industrial Scenarios
<div align="center">
[![HuggingFace](https://img.shields.io/badge/🤗-Model%20Hub-yellow)](https://huggingface.co/Multilingual-Multimodal-NLP/IndustrialCoder-Base)
[![GitHub](https://img.shields.io/badge/GitHub-Industrial--Coder-blue)](https://github.com/CSJianYang/Industrial-Coder)
[![arXiv](https://img.shields.io/badge/arXiv-2603.16790-red)](https://huggingface.co/papers/2603.16790)
[![License](https://img.shields.io/badge/License-Apache%202.0-green)](LICENSE)
</div>
## Model Summary
**InCoder-32B-Base** is the pre-trained base model of the InCoder family — the first 32B-parameter code foundation model purpose-built for industrial code intelligence. This is the base (non-instruction-tuned) checkpoint, suitable for code completion, fill-in-the-middle (FIM), and further fine-tuning.
For the instruction-tuned variant, see [IndustrialCoder](https://huggingface.co/Multilingual-Multimodal-NLP/IndustrialCoder). For the reasoning variant, see [IndustrialCoder-Thinking](https://huggingface.co/Multilingual-Multimodal-NLP/IndustrialCoder-Thinking).
Presented in the paper [InCoder-32B: Code Foundation Model for Industrial Scenarios](https://huggingface.co/papers/2603.16790), InCoder-32B unifies code intelligence across five industrial domains:
| Domain | Languages & Frameworks |
|---|---|
| 🔧 **Chip Design** | Verilog, SystemVerilog, RTL |
| ⚡ **GPU Kernel Optimization** | CUDA, Triton |
| 🖥️ **Embedded Systems** | C/C++, ARM Cortex-M4, STM32 |
| 🔨 **Compiler Optimization** | x86-64 ASM, C/C++, LLVM-IR |
| 📐 **3D Modeling / CAD** | CadQuery, OpenCascade, Python |
---
## Model Architecture
InCoder-32B-Base adopts a standard decoder-only Transformer architecture:
| Hyperparameter | Value |
|---|---|
| Parameters | ~32B |
| Layers | 64 |
| Hidden Size | 5,120 |
| Attention Heads | 40 (8 KV heads, GQA) |
| Max Context Length | 131,072 (128K) |
| Positional Encoding | RoPE (θ = 500,000) |
| Precision | BFloat16 |
| Vocabulary Size | 76,800 |
---
## Training Pipeline: Code-Flow
InCoder-32B-Base is trained through a two-stage **Code-Flow** pipeline:
### Stage 1 — Pre-training & Annealing
- **Industrial Recall**: Data pipeline using rule-based filtering, FastText classifiers, and semantic retrieval for Verilog, CUDA, firmware C, and CadQuery.
- **Refinement**: OCR extraction from technical manuals, multi-level deduplication, and repository-level fork consolidation.
- **Training**: 15T total tokens using Autoregressive LM + Fill-in-the-Middle (FIM) objectives on 4,096 GPUs.
### Stage 2 — Mid-Training (Context Extension)
Context window extended progressively from 8K to 128K tokens:
- **8K → 32K**: Targets file-level tasks like completing RTL modules or kernel functions.
- **32K → 128K**: Unlocks long-context capabilities for extended debugging and cross-module projects.
---
## Usage
### Installation
```bash
pip install transformers accelerate
```
### Code Completion
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "Multilingual-Multimodal-NLP/IndustrialCoder-Base"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
prompt = """// Synthesizable Verilog: UART transmitter (8N1 protocol)
module uart_tx (
input wire clk,
input wire rst_n,
input wire [7:0] data_in,
input wire tx_start,
output reg tx,
output reg tx_busy
);
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.2,
do_sample=True,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
### Fill-in-the-Middle (FIM)
InCoder-32B-Base supports FIM completion for code infilling tasks:
```python
prefix = """// CUDA kernel for RMS Normalization
__global__ void rms_norm_kernel(float* output, const float* input,
const float* weight, int N, float eps) {
int idx = blockIdx.x;
"""
suffix = """
output[idx * N + tid] = normalized * weight[tid];
}"""
fim_prompt = f"<|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>"
inputs = tokenizer(fim_prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
### Deployment with vLLM
```bash
vllm serve Multilingual-Multimodal-NLP/IndustrialCoder-Base \
--tensor-parallel-size 4 --max-model-len 32768 --trust-remote-code
```
---
## Fine-tuning
We provide an SFT framework in the [GitHub repository](https://github.com/CSJianYang/Industrial-Coder/tree/main/sft). See the README for data preparation and training instructions.
---
## Model Family
| Model | Type | HuggingFace |
|---|---|---|
| InCoder-32B-Base | Pre-trained | [🤗 IndustrialCoder-Base](https://huggingface.co/Multilingual-Multimodal-NLP/IndustrialCoder-Base) |
| InCoder-32B | Instruct | [🤗 IndustrialCoder](https://huggingface.co/Multilingual-Multimodal-NLP/IndustrialCoder) |
| InCoder-32B-Thinking | Reasoning | [🤗 IndustrialCoder-Thinking](https://huggingface.co/Multilingual-Multimodal-NLP/IndustrialCoder-Thinking) |
| InCoder-32B-FP8 | FP8 Quantized | [🤗 IndustrialCoder-32B-FP8](https://huggingface.co/Multilingual-Multimodal-NLP/IndustrialCoder-32B-FP8) |
| InCoder-32B-AWQ-INT4 | AWQ INT4 | [🤗 IndustrialCoder-32B-AWQ-INT4](https://huggingface.co/Multilingual-Multimodal-NLP/IndustrialCoder-32B-AWQ-INT4) |
| InCoder-32B-GPTQ-INT4 | GPTQ INT4 | [🤗 IndustrialCoder-32B-GPTQ-INT4](https://huggingface.co/Multilingual-Multimodal-NLP/IndustrialCoder-32B-GPTQ-INT4) |
---
## Limitations & Disclaimers
This is a **base model** — it has not been instruction-tuned and does not follow conversational instructions. It is best suited for:
- Code completion and generation
- Fill-in-the-middle (FIM) tasks
- Further fine-tuning for downstream applications
Always review and test generated code in a sandboxed environment. Industrial code (RTL, embedded firmware, GPU kernels) requires expert review before deployment.
---
## Citation
```bibtex
@article{yang2026incoder,
title={InCoder-32B: Code Foundation Model for Industrial Scenarios},
author={Yang, Jian and Zhang, Wei and Wu, Jiajun and Cheng, Junhang and Guo, Shawn
and Wang, Haowen and Gu, Weicheng and Du, Yaxin and Li, Joseph and Xu, Fanglin
and others},
journal={arXiv preprint arXiv:2603.16790},
year={2026}
}
```

33
config.json Normal file
View File

@@ -0,0 +1,33 @@
{
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 1,
"eos_token_id": [
2,
75864,
75869
],
"head_dim": 128,
"hidden_act": "silu",
"hidden_size": 5120,
"initializer_range": 0.02,
"intermediate_size": 27648,
"max_position_embeddings": 131072,
"mlp_bias": false,
"model_type": "llama",
"num_attention_heads": 40,
"num_hidden_layers": 64,
"num_key_value_heads": 8,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_scaling": null,
"rope_theta": 500000,
"tie_word_embeddings": false,
"torch_dtype": "bfloat16",
"transformers_version": "4.55.4",
"use_cache": true,
"vocab_size": 76800
}

View File

@@ -0,0 +1,182 @@
"""IQuestCoder model configuration."""
from transformers.configuration_utils import PretrainedConfig
from transformers.utils import logging
logger = logging.get_logger(__name__)
class IQuestCoderConfig(PretrainedConfig):
r"""
This is the configuration class to store the configuration of a [`IQuestCoderModel`]. It is used to instantiate
an IQuestCoder model according to the specified arguments, defining the model architecture.
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
documentation from [`PretrainedConfig`] for more information.
Args:
vocab_size (`int`, *optional*, defaults to 76800):
Vocabulary size of the IQuestCoder model. Defines the number of different tokens that can be represented
by the `inputs_ids` passed when calling [`IQuestCoderModel`].
hidden_size (`int`, *optional*, defaults to 5120):
Dimension of the hidden representations.
intermediate_size (`int`, *optional*, defaults to 27648):
Dimension of the MLP representations.
num_hidden_layers (`int`, *optional*, defaults to 80):
Number of hidden layers in the Transformer decoder.
num_attention_heads (`int`, *optional*, defaults to 40):
Number of attention heads for each attention layer in the Transformer decoder.
num_key_value_heads (`int`, *optional*, defaults to 8):
This is the number of key_value heads that should be used to implement Grouped Query Attention (GQA).
If `num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA).
If `num_key_value_heads=1`, the model will use Multi Query Attention (MQA).
head_dim (`int`, *optional*, defaults to 128):
The dimension of each attention head. If not specified, defaults to `hidden_size // num_attention_heads`.
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
The non-linear activation function (function or string) in the decoder.
max_position_embeddings (`int`, *optional*, defaults to 16384):
The maximum sequence length that this model might ever be used with.
initializer_range (`float`, *optional*, defaults to 0.02):
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
rms_norm_eps (`float`, *optional*, defaults to 1e-05):
The epsilon used by the rms normalization layers.
use_cache (`bool`, *optional*, defaults to `True`):
Whether or not the model should return the last key/values attentions (not used by all models).
pad_token_id (`int`, *optional*):
Padding token id.
bos_token_id (`int`, *optional*, defaults to 1):
Beginning of stream token id.
eos_token_id (`int`, *optional*, defaults to 2):
End of stream token id.
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
Whether to tie weight embeddings.
rope_theta (`float`, *optional*, defaults to 500000.0):
The base period of the RoPE embeddings.
rope_scaling (`Dict`, *optional*):
Dictionary containing the scaling configuration for the RoPE embeddings. Supports various RoPE scaling
types including "linear", "dynamic", "yarn", "longrope", etc.
attention_bias (`bool`, *optional*, defaults to `False`):
Whether to use a bias in the query, key, value and output projection layers during self-attention.
attention_dropout (`float`, *optional*, defaults to 0.0):
The dropout ratio for the attention probabilities.
mlp_bias (`bool`, *optional*, defaults to `False`):
Whether to use a bias in up_proj, down_proj and gate_proj layers in the MLP layers.
clip_qkv (`float`, *optional*):
If set, clip the query, key, and value tensors to this value. Borrowed from OLMo for training stability.
use_sliding_window (`bool`, *optional*, defaults to `False`):
Whether to use sliding window attention. Borrowed from Qwen2.
sliding_window (`int`, *optional*):
The sliding window size. Only effective when `use_sliding_window=True`.
max_window_layers (`int`, *optional*, defaults to 0):
The number of layers that don't use sliding window attention. Borrowed from Qwen2.
Example:
```python
>>> from configuration_iquestcoder import IQuestCoderConfig
>>> from modeling_iquestcoder import IQuestCoderModel
>>> # Initializing a IQuestCoder configuration
>>> configuration = IQuestCoderConfig()
>>> # Initializing a model from the configuration
>>> model = IQuestCoderModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
```
"""
model_type = "iquestcoder"
keys_to_ignore_at_inference = ["past_key_values"]
def __init__(
self,
vocab_size=76800,
hidden_size=5120,
intermediate_size=27648,
num_hidden_layers=80,
num_attention_heads=40,
num_key_value_heads=8,
head_dim=128,
hidden_act="silu",
max_position_embeddings=16384,
initializer_range=0.02,
rms_norm_eps=1e-5,
use_cache=True,
pad_token_id=None,
bos_token_id=1,
eos_token_id=2,
tie_word_embeddings=False,
rope_theta=500000.0,
rope_scaling=None,
attention_bias=False,
attention_dropout=0.0,
mlp_bias=False,
# IQuestCoder specific (borrowed from OLMo)
clip_qkv=None,
# IQuestCoder specific (borrowed from Qwen2)
use_sliding_window=False,
sliding_window=None,
max_window_layers=0,
**kwargs,
):
self.vocab_size = vocab_size
self.max_position_embeddings = max_position_embeddings
self.hidden_size = hidden_size
self.intermediate_size = intermediate_size
self.num_hidden_layers = num_hidden_layers
self.num_attention_heads = num_attention_heads
self.num_key_value_heads = num_key_value_heads
self.head_dim = head_dim
self.hidden_act = hidden_act
self.initializer_range = initializer_range
self.rms_norm_eps = rms_norm_eps
self.use_cache = use_cache
self.rope_theta = rope_theta
self.rope_scaling = rope_scaling
self.attention_bias = attention_bias
self.attention_dropout = attention_dropout
self.mlp_bias = mlp_bias
# IQuestCoder specific
self.clip_qkv = clip_qkv
self.use_sliding_window = use_sliding_window
self.sliding_window = sliding_window
self.max_window_layers = max_window_layers
# Validate rope_scaling configuration
self._rope_scaling_validation()
super().__init__(
pad_token_id=pad_token_id,
bos_token_id=bos_token_id,
eos_token_id=eos_token_id,
tie_word_embeddings=tie_word_embeddings,
**kwargs,
)
def _rope_scaling_validation(self):
"""Validate the `rope_scaling` configuration."""
if self.rope_scaling is None:
return
if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) < 1:
raise ValueError(
"`rope_scaling` must be a dictionary with a minimum of one field, `type` or `rope_type`."
)
rope_scaling_type = self.rope_scaling.get("type", None) or self.rope_scaling.get("rope_type", None)
if rope_scaling_type is None:
raise ValueError(
"`rope_scaling` must have a `type` or `rope_type` field."
)
valid_rope_types = ["linear", "dynamic", "yarn", "longrope", "llama3"]
if rope_scaling_type not in valid_rope_types:
raise ValueError(
f"`rope_scaling`'s type field must be one of {valid_rope_types}, got {rope_scaling_type}"
)
__all__ = ["IQuestCoderConfig"]

6
generation_config.json Normal file
View File

@@ -0,0 +1,6 @@
{
"_from_model_config": true,
"bos_token_id": 1,
"eos_token_id": [2, 75864, 75869],
"transformers_version": "4.55.4"
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:69006dee33f4335aaa693e12e92ecc051f16c5b498188a022515145533beaa58
size 5358309312

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:115b53f7ad7d75a01d364f1cf6b431a41372d2ee0982fa0de87c655e5f37248d
size 5274455744

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:48a960c70fe7416cea7407d3786fe2be847e8f5ec3249e7c4b9a787987104536
size 5159101664

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bba8ab6116ea38144ebf68f2f53a1ed770536ccf3a4dd0304664560eda726e4e
size 5284951976

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7f0700362502e719d00bef14db06ca58e1ca3c52e532a06f58e26f4f32b0a31a
size 5159101664

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7616544c846b71d90fc493182b42bb3dd5c1c02ae6bbfa1da777e040e2dfe34d
size 5159101680

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:19f166df6e0c2c83f042cb0604d15b5f9cfc8cd3ea1fb4a5d2d524cdd43d955f
size 5284951968

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f71158f6fcca3945bbd54040a400477b6b834e7468faa7ec9454eb690f2c1839
size 5159101680

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3d1e34385a2ec4fdff956bb4ad1ae6f68da6f426efc023e017339a1b37d3a16b
size 5159101664

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7fdc7a3909dd1a3eb314fb5b49d0bfe390f19f6c269640d048036d0ee20421c9
size 5284951976

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0c2ab1f5030af66fc9c525b48a10ae2b91ac5d62c0991c1262f1f0ae110a4995
size 5159101664

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:489f0a22a4aa4df6ee6d32d81cc963d7188fbb13ed79306de02ebdad7a2f19ce
size 5159101664

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ea6fdce4a0b497d54f1aaa7d33057c0c73448fb90f28fcb9b33b53ddea3b17d1
size 1384163096

View File

@@ -0,0 +1,586 @@
{
"metadata": {
"total_size": 63985428480
},
"weight_map": {
"lm_head.weight": "model-00001-of-00013.safetensors",
"model.embed_tokens.weight": "model-00001-of-00013.safetensors",
"model.layers.0.input_layernorm.weight": "model-00001-of-00013.safetensors",
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00013.safetensors",
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.1.input_layernorm.weight": "model-00001-of-00013.safetensors",
"model.layers.1.mlp.down_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.1.mlp.gate_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.1.mlp.up_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00013.safetensors",
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.10.input_layernorm.weight": "model-00001-of-00013.safetensors",
"model.layers.10.mlp.down_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.10.mlp.gate_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.10.mlp.up_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.10.post_attention_layernorm.weight": "model-00001-of-00013.safetensors",
"model.layers.10.self_attn.k_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.10.self_attn.o_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.10.self_attn.q_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.10.self_attn.v_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.11.input_layernorm.weight": "model-00001-of-00013.safetensors",
"model.layers.11.mlp.down_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.11.mlp.gate_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.11.mlp.up_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.11.post_attention_layernorm.weight": "model-00001-of-00013.safetensors",
"model.layers.11.self_attn.k_proj.weight": "model-00001-of-00013.safetensors",
"model.layers.11.self_attn.o_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.11.self_attn.q_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.11.self_attn.v_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.12.input_layernorm.weight": "model-00002-of-00013.safetensors",
"model.layers.12.mlp.down_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.12.mlp.gate_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.12.mlp.up_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.12.post_attention_layernorm.weight": "model-00002-of-00013.safetensors",
"model.layers.12.self_attn.k_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.12.self_attn.o_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.12.self_attn.q_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.12.self_attn.v_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.13.input_layernorm.weight": "model-00002-of-00013.safetensors",
"model.layers.13.mlp.down_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.13.mlp.gate_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.13.mlp.up_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.13.post_attention_layernorm.weight": "model-00002-of-00013.safetensors",
"model.layers.13.self_attn.k_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.13.self_attn.o_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.13.self_attn.q_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.13.self_attn.v_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.14.input_layernorm.weight": "model-00002-of-00013.safetensors",
"model.layers.14.mlp.down_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.14.mlp.gate_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.14.mlp.up_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.14.post_attention_layernorm.weight": "model-00002-of-00013.safetensors",
"model.layers.14.self_attn.k_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.14.self_attn.o_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.14.self_attn.q_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.14.self_attn.v_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.15.input_layernorm.weight": "model-00002-of-00013.safetensors",
"model.layers.15.mlp.down_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.15.mlp.gate_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.15.mlp.up_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.15.post_attention_layernorm.weight": "model-00002-of-00013.safetensors",
"model.layers.15.self_attn.k_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.15.self_attn.o_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.15.self_attn.q_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.15.self_attn.v_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.16.input_layernorm.weight": "model-00002-of-00013.safetensors",
"model.layers.16.mlp.down_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.16.mlp.gate_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.16.mlp.up_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.16.post_attention_layernorm.weight": "model-00002-of-00013.safetensors",
"model.layers.16.self_attn.k_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.16.self_attn.o_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.16.self_attn.q_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.16.self_attn.v_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.17.input_layernorm.weight": "model-00002-of-00013.safetensors",
"model.layers.17.mlp.down_proj.weight": "model-00002-of-00013.safetensors",
"model.layers.17.mlp.gate_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.17.mlp.up_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.17.post_attention_layernorm.weight": "model-00003-of-00013.safetensors",
"model.layers.17.self_attn.k_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.17.self_attn.o_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.17.self_attn.q_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.17.self_attn.v_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.18.input_layernorm.weight": "model-00003-of-00013.safetensors",
"model.layers.18.mlp.down_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.18.mlp.gate_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.18.mlp.up_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.18.post_attention_layernorm.weight": "model-00003-of-00013.safetensors",
"model.layers.18.self_attn.k_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.18.self_attn.o_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.18.self_attn.q_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.18.self_attn.v_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.19.input_layernorm.weight": "model-00003-of-00013.safetensors",
"model.layers.19.mlp.down_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.19.mlp.gate_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.19.mlp.up_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.19.post_attention_layernorm.weight": "model-00003-of-00013.safetensors",
"model.layers.19.self_attn.k_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.19.self_attn.o_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.19.self_attn.q_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.19.self_attn.v_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.2.input_layernorm.weight": "model-00003-of-00013.safetensors",
"model.layers.2.mlp.down_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.2.mlp.gate_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.2.mlp.up_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.2.post_attention_layernorm.weight": "model-00003-of-00013.safetensors",
"model.layers.2.self_attn.k_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.2.self_attn.o_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.2.self_attn.q_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.2.self_attn.v_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.20.input_layernorm.weight": "model-00003-of-00013.safetensors",
"model.layers.20.mlp.down_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.20.mlp.gate_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.20.mlp.up_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.20.post_attention_layernorm.weight": "model-00003-of-00013.safetensors",
"model.layers.20.self_attn.k_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.20.self_attn.o_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.20.self_attn.q_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.20.self_attn.v_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.21.input_layernorm.weight": "model-00003-of-00013.safetensors",
"model.layers.21.mlp.down_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.21.mlp.gate_proj.weight": "model-00003-of-00013.safetensors",
"model.layers.21.mlp.up_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.21.post_attention_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.21.self_attn.k_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.21.self_attn.o_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.21.self_attn.q_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.21.self_attn.v_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.22.input_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.22.mlp.down_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.22.mlp.gate_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.22.mlp.up_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.22.post_attention_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.22.self_attn.k_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.22.self_attn.o_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.22.self_attn.q_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.22.self_attn.v_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.23.input_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.23.mlp.down_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.23.mlp.gate_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.23.mlp.up_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.23.post_attention_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.23.self_attn.k_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.23.self_attn.o_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.23.self_attn.q_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.23.self_attn.v_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.24.input_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.24.mlp.down_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.24.mlp.gate_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.24.mlp.up_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.24.post_attention_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.24.self_attn.k_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.24.self_attn.o_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.24.self_attn.q_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.24.self_attn.v_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.25.input_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.25.mlp.down_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.25.mlp.gate_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.25.mlp.up_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.25.post_attention_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.25.self_attn.k_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.25.self_attn.o_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.25.self_attn.q_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.25.self_attn.v_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.26.input_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.26.mlp.down_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.26.mlp.gate_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.26.mlp.up_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.26.post_attention_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.26.self_attn.k_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.26.self_attn.o_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.26.self_attn.q_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.26.self_attn.v_proj.weight": "model-00004-of-00013.safetensors",
"model.layers.27.input_layernorm.weight": "model-00004-of-00013.safetensors",
"model.layers.27.mlp.down_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.27.mlp.gate_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.27.mlp.up_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.27.post_attention_layernorm.weight": "model-00005-of-00013.safetensors",
"model.layers.27.self_attn.k_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.27.self_attn.o_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.27.self_attn.q_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.27.self_attn.v_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.28.input_layernorm.weight": "model-00005-of-00013.safetensors",
"model.layers.28.mlp.down_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.28.mlp.gate_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.28.mlp.up_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.28.post_attention_layernorm.weight": "model-00005-of-00013.safetensors",
"model.layers.28.self_attn.k_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.28.self_attn.o_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.28.self_attn.q_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.28.self_attn.v_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.29.input_layernorm.weight": "model-00005-of-00013.safetensors",
"model.layers.29.mlp.down_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.29.mlp.gate_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.29.mlp.up_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.29.post_attention_layernorm.weight": "model-00005-of-00013.safetensors",
"model.layers.29.self_attn.k_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.29.self_attn.o_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.29.self_attn.q_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.29.self_attn.v_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.3.input_layernorm.weight": "model-00005-of-00013.safetensors",
"model.layers.3.mlp.down_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.3.mlp.gate_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.3.mlp.up_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.3.post_attention_layernorm.weight": "model-00005-of-00013.safetensors",
"model.layers.3.self_attn.k_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.3.self_attn.o_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.3.self_attn.q_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.3.self_attn.v_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.30.input_layernorm.weight": "model-00005-of-00013.safetensors",
"model.layers.30.mlp.down_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.30.mlp.gate_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.30.mlp.up_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.30.post_attention_layernorm.weight": "model-00005-of-00013.safetensors",
"model.layers.30.self_attn.k_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.30.self_attn.o_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.30.self_attn.q_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.30.self_attn.v_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.31.input_layernorm.weight": "model-00005-of-00013.safetensors",
"model.layers.31.mlp.down_proj.weight": "model-00005-of-00013.safetensors",
"model.layers.31.mlp.gate_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.31.mlp.up_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.31.post_attention_layernorm.weight": "model-00006-of-00013.safetensors",
"model.layers.31.self_attn.k_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.31.self_attn.o_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.31.self_attn.q_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.31.self_attn.v_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.32.input_layernorm.weight": "model-00006-of-00013.safetensors",
"model.layers.32.mlp.down_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.32.mlp.gate_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.32.mlp.up_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.32.post_attention_layernorm.weight": "model-00006-of-00013.safetensors",
"model.layers.32.self_attn.k_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.32.self_attn.o_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.32.self_attn.q_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.32.self_attn.v_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.33.input_layernorm.weight": "model-00006-of-00013.safetensors",
"model.layers.33.mlp.down_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.33.mlp.gate_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.33.mlp.up_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.33.post_attention_layernorm.weight": "model-00006-of-00013.safetensors",
"model.layers.33.self_attn.k_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.33.self_attn.o_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.33.self_attn.q_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.33.self_attn.v_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.34.input_layernorm.weight": "model-00006-of-00013.safetensors",
"model.layers.34.mlp.down_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.34.mlp.gate_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.34.mlp.up_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.34.post_attention_layernorm.weight": "model-00006-of-00013.safetensors",
"model.layers.34.self_attn.k_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.34.self_attn.o_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.34.self_attn.q_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.34.self_attn.v_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.35.input_layernorm.weight": "model-00006-of-00013.safetensors",
"model.layers.35.mlp.down_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.35.mlp.gate_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.35.mlp.up_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.35.post_attention_layernorm.weight": "model-00006-of-00013.safetensors",
"model.layers.35.self_attn.k_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.35.self_attn.o_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.35.self_attn.q_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.35.self_attn.v_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.36.input_layernorm.weight": "model-00006-of-00013.safetensors",
"model.layers.36.mlp.down_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.36.mlp.gate_proj.weight": "model-00006-of-00013.safetensors",
"model.layers.36.mlp.up_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.36.post_attention_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.36.self_attn.k_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.36.self_attn.o_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.36.self_attn.q_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.36.self_attn.v_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.37.input_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.37.mlp.down_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.37.mlp.gate_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.37.mlp.up_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.37.post_attention_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.37.self_attn.k_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.37.self_attn.o_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.37.self_attn.q_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.37.self_attn.v_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.38.input_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.38.mlp.down_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.38.mlp.gate_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.38.mlp.up_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.38.post_attention_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.38.self_attn.k_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.38.self_attn.o_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.38.self_attn.q_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.38.self_attn.v_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.39.input_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.39.mlp.down_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.39.mlp.gate_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.39.mlp.up_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.39.post_attention_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.39.self_attn.k_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.39.self_attn.o_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.39.self_attn.q_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.39.self_attn.v_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.4.input_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.4.mlp.down_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.4.mlp.gate_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.4.mlp.up_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.4.post_attention_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.4.self_attn.k_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.4.self_attn.o_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.4.self_attn.q_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.4.self_attn.v_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.40.input_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.40.mlp.down_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.40.mlp.gate_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.40.mlp.up_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.40.post_attention_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.40.self_attn.k_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.40.self_attn.o_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.40.self_attn.q_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.40.self_attn.v_proj.weight": "model-00007-of-00013.safetensors",
"model.layers.41.input_layernorm.weight": "model-00007-of-00013.safetensors",
"model.layers.41.mlp.down_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.41.mlp.gate_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.41.mlp.up_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.41.post_attention_layernorm.weight": "model-00008-of-00013.safetensors",
"model.layers.41.self_attn.k_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.41.self_attn.o_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.41.self_attn.q_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.41.self_attn.v_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.42.input_layernorm.weight": "model-00008-of-00013.safetensors",
"model.layers.42.mlp.down_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.42.mlp.gate_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.42.mlp.up_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.42.post_attention_layernorm.weight": "model-00008-of-00013.safetensors",
"model.layers.42.self_attn.k_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.42.self_attn.o_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.42.self_attn.q_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.42.self_attn.v_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.43.input_layernorm.weight": "model-00008-of-00013.safetensors",
"model.layers.43.mlp.down_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.43.mlp.gate_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.43.mlp.up_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.43.post_attention_layernorm.weight": "model-00008-of-00013.safetensors",
"model.layers.43.self_attn.k_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.43.self_attn.o_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.43.self_attn.q_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.43.self_attn.v_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.44.input_layernorm.weight": "model-00008-of-00013.safetensors",
"model.layers.44.mlp.down_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.44.mlp.gate_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.44.mlp.up_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.44.post_attention_layernorm.weight": "model-00008-of-00013.safetensors",
"model.layers.44.self_attn.k_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.44.self_attn.o_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.44.self_attn.q_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.44.self_attn.v_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.45.input_layernorm.weight": "model-00008-of-00013.safetensors",
"model.layers.45.mlp.down_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.45.mlp.gate_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.45.mlp.up_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.45.post_attention_layernorm.weight": "model-00008-of-00013.safetensors",
"model.layers.45.self_attn.k_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.45.self_attn.o_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.45.self_attn.q_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.45.self_attn.v_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.46.input_layernorm.weight": "model-00008-of-00013.safetensors",
"model.layers.46.mlp.down_proj.weight": "model-00008-of-00013.safetensors",
"model.layers.46.mlp.gate_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.46.mlp.up_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.46.post_attention_layernorm.weight": "model-00009-of-00013.safetensors",
"model.layers.46.self_attn.k_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.46.self_attn.o_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.46.self_attn.q_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.46.self_attn.v_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.47.input_layernorm.weight": "model-00009-of-00013.safetensors",
"model.layers.47.mlp.down_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.47.mlp.gate_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.47.mlp.up_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.47.post_attention_layernorm.weight": "model-00009-of-00013.safetensors",
"model.layers.47.self_attn.k_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.47.self_attn.o_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.47.self_attn.q_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.47.self_attn.v_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.48.input_layernorm.weight": "model-00009-of-00013.safetensors",
"model.layers.48.mlp.down_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.48.mlp.gate_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.48.mlp.up_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.48.post_attention_layernorm.weight": "model-00009-of-00013.safetensors",
"model.layers.48.self_attn.k_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.48.self_attn.o_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.48.self_attn.q_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.48.self_attn.v_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.49.input_layernorm.weight": "model-00009-of-00013.safetensors",
"model.layers.49.mlp.down_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.49.mlp.gate_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.49.mlp.up_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.49.post_attention_layernorm.weight": "model-00009-of-00013.safetensors",
"model.layers.49.self_attn.k_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.49.self_attn.o_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.49.self_attn.q_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.49.self_attn.v_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.5.input_layernorm.weight": "model-00009-of-00013.safetensors",
"model.layers.5.mlp.down_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.5.mlp.gate_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.5.mlp.up_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.5.post_attention_layernorm.weight": "model-00009-of-00013.safetensors",
"model.layers.5.self_attn.k_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.5.self_attn.o_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.5.self_attn.q_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.5.self_attn.v_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.50.input_layernorm.weight": "model-00009-of-00013.safetensors",
"model.layers.50.mlp.down_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.50.mlp.gate_proj.weight": "model-00009-of-00013.safetensors",
"model.layers.50.mlp.up_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.50.post_attention_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.50.self_attn.k_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.50.self_attn.o_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.50.self_attn.q_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.50.self_attn.v_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.51.input_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.51.mlp.down_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.51.mlp.gate_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.51.mlp.up_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.51.post_attention_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.51.self_attn.k_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.51.self_attn.o_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.51.self_attn.q_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.51.self_attn.v_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.52.input_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.52.mlp.down_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.52.mlp.gate_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.52.mlp.up_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.52.post_attention_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.52.self_attn.k_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.52.self_attn.o_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.52.self_attn.q_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.52.self_attn.v_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.53.input_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.53.mlp.down_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.53.mlp.gate_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.53.mlp.up_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.53.post_attention_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.53.self_attn.k_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.53.self_attn.o_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.53.self_attn.q_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.53.self_attn.v_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.54.input_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.54.mlp.down_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.54.mlp.gate_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.54.mlp.up_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.54.post_attention_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.54.self_attn.k_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.54.self_attn.o_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.54.self_attn.q_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.54.self_attn.v_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.55.input_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.55.mlp.down_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.55.mlp.gate_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.55.mlp.up_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.55.post_attention_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.55.self_attn.k_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.55.self_attn.o_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.55.self_attn.q_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.55.self_attn.v_proj.weight": "model-00010-of-00013.safetensors",
"model.layers.56.input_layernorm.weight": "model-00010-of-00013.safetensors",
"model.layers.56.mlp.down_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.56.mlp.gate_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.56.mlp.up_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.56.post_attention_layernorm.weight": "model-00011-of-00013.safetensors",
"model.layers.56.self_attn.k_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.56.self_attn.o_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.56.self_attn.q_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.56.self_attn.v_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.57.input_layernorm.weight": "model-00011-of-00013.safetensors",
"model.layers.57.mlp.down_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.57.mlp.gate_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.57.mlp.up_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.57.post_attention_layernorm.weight": "model-00011-of-00013.safetensors",
"model.layers.57.self_attn.k_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.57.self_attn.o_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.57.self_attn.q_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.57.self_attn.v_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.58.input_layernorm.weight": "model-00011-of-00013.safetensors",
"model.layers.58.mlp.down_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.58.mlp.gate_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.58.mlp.up_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.58.post_attention_layernorm.weight": "model-00011-of-00013.safetensors",
"model.layers.58.self_attn.k_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.58.self_attn.o_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.58.self_attn.q_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.58.self_attn.v_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.59.input_layernorm.weight": "model-00011-of-00013.safetensors",
"model.layers.59.mlp.down_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.59.mlp.gate_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.59.mlp.up_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.59.post_attention_layernorm.weight": "model-00011-of-00013.safetensors",
"model.layers.59.self_attn.k_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.59.self_attn.o_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.59.self_attn.q_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.59.self_attn.v_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.6.input_layernorm.weight": "model-00011-of-00013.safetensors",
"model.layers.6.mlp.down_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.6.mlp.gate_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.6.mlp.up_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.6.post_attention_layernorm.weight": "model-00011-of-00013.safetensors",
"model.layers.6.self_attn.k_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.6.self_attn.o_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.6.self_attn.q_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.6.self_attn.v_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.60.input_layernorm.weight": "model-00011-of-00013.safetensors",
"model.layers.60.mlp.down_proj.weight": "model-00011-of-00013.safetensors",
"model.layers.60.mlp.gate_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.60.mlp.up_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.60.post_attention_layernorm.weight": "model-00012-of-00013.safetensors",
"model.layers.60.self_attn.k_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.60.self_attn.o_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.60.self_attn.q_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.60.self_attn.v_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.61.input_layernorm.weight": "model-00012-of-00013.safetensors",
"model.layers.61.mlp.down_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.61.mlp.gate_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.61.mlp.up_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.61.post_attention_layernorm.weight": "model-00012-of-00013.safetensors",
"model.layers.61.self_attn.k_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.61.self_attn.o_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.61.self_attn.q_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.61.self_attn.v_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.62.input_layernorm.weight": "model-00012-of-00013.safetensors",
"model.layers.62.mlp.down_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.62.mlp.gate_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.62.mlp.up_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.62.post_attention_layernorm.weight": "model-00012-of-00013.safetensors",
"model.layers.62.self_attn.k_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.62.self_attn.o_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.62.self_attn.q_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.62.self_attn.v_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.63.input_layernorm.weight": "model-00012-of-00013.safetensors",
"model.layers.63.mlp.down_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.63.mlp.gate_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.63.mlp.up_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.63.post_attention_layernorm.weight": "model-00012-of-00013.safetensors",
"model.layers.63.self_attn.k_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.63.self_attn.o_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.63.self_attn.q_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.63.self_attn.v_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.7.input_layernorm.weight": "model-00012-of-00013.safetensors",
"model.layers.7.mlp.down_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.7.mlp.gate_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.7.mlp.up_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.7.post_attention_layernorm.weight": "model-00012-of-00013.safetensors",
"model.layers.7.self_attn.k_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.7.self_attn.o_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.7.self_attn.q_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.7.self_attn.v_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.8.input_layernorm.weight": "model-00012-of-00013.safetensors",
"model.layers.8.mlp.down_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.8.mlp.gate_proj.weight": "model-00012-of-00013.safetensors",
"model.layers.8.mlp.up_proj.weight": "model-00013-of-00013.safetensors",
"model.layers.8.post_attention_layernorm.weight": "model-00013-of-00013.safetensors",
"model.layers.8.self_attn.k_proj.weight": "model-00013-of-00013.safetensors",
"model.layers.8.self_attn.o_proj.weight": "model-00013-of-00013.safetensors",
"model.layers.8.self_attn.q_proj.weight": "model-00013-of-00013.safetensors",
"model.layers.8.self_attn.v_proj.weight": "model-00013-of-00013.safetensors",
"model.layers.9.input_layernorm.weight": "model-00013-of-00013.safetensors",
"model.layers.9.mlp.down_proj.weight": "model-00013-of-00013.safetensors",
"model.layers.9.mlp.gate_proj.weight": "model-00013-of-00013.safetensors",
"model.layers.9.mlp.up_proj.weight": "model-00013-of-00013.safetensors",
"model.layers.9.post_attention_layernorm.weight": "model-00013-of-00013.safetensors",
"model.layers.9.self_attn.k_proj.weight": "model-00013-of-00013.safetensors",
"model.layers.9.self_attn.o_proj.weight": "model-00013-of-00013.safetensors",
"model.layers.9.self_attn.q_proj.weight": "model-00013-of-00013.safetensors",
"model.layers.9.self_attn.v_proj.weight": "model-00013-of-00013.safetensors",
"model.norm.weight": "model-00013-of-00013.safetensors"
}
}

1063
modeling_iquestcoder.py Normal file

File diff suppressed because it is too large Load Diff

552
tokenization_iquestcoder.py Normal file
View File

@@ -0,0 +1,552 @@
"""Tokenization classes for IQuestCoder."""
import os
from shutil import copyfile
from typing import Any, Dict, List, Optional, Tuple, Union
import sentencepiece as spm
from transformers.tokenization_utils import AddedToken, PreTrainedTokenizer
from transformers.utils import logging
logger = logging.get_logger(__name__)
VOCAB_FILES_NAMES = {"vocab_file": "tokenizer.model"}
PRETRAINED_VOCAB_FILES_MAP = {
"vocab_file": {},
"tokenizer_file": {},
}
PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {}
class IQuestCoderTokenizer(PreTrainedTokenizer):
vocab_files_names = VOCAB_FILES_NAMES
pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP
max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
model_input_names = ["input_ids", "attention_mask"]
def __init__(
self,
vocab_file,
unk_token="<unk>",
bos_token="<s>",
eos_token="</s>",
pad_token=None,
sp_model_kwargs: Optional[Dict[str, Any]] = None,
add_bos_token=True,
add_eos_token=False,
clean_up_tokenization_spaces=False,
add_prefix_space=False,
legacy=None,
use_default_system_prompt=False,
chat_template=None,
**kwargs,
):
self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
bos_token = AddedToken(bos_token, lstrip=False, rstrip=False) if isinstance(bos_token, str) else bos_token
eos_token = AddedToken(eos_token, lstrip=False, rstrip=False) if isinstance(eos_token, str) else eos_token
unk_token = AddedToken(unk_token, lstrip=False, rstrip=False) if isinstance(unk_token, str) else unk_token
pad_token = AddedToken(pad_token, lstrip=False, rstrip=False) if isinstance(pad_token, str) else pad_token
# Legacy behavior handling
if legacy is None:
logger.warning_once(
f"You are using the default legacy behaviour of the {self.__class__.__name__}. This is"
" expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you."
" If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it"
" means, and thoroughly read the reason why this was added as explained in"
" https://github.com/huggingface/transformers/pull/24565"
)
legacy = True
self.legacy = legacy
self.vocab_file = vocab_file
self.add_bos_token = add_bos_token
self.add_eos_token = add_eos_token
self.add_prefix_space = add_prefix_space
self.use_default_system_prompt = use_default_system_prompt
self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
self.sp_model.Load(vocab_file)
super().__init__(
bos_token=bos_token,
eos_token=eos_token,
unk_token=unk_token,
pad_token=pad_token,
add_bos_token=add_bos_token,
add_eos_token=add_eos_token,
sp_model_kwargs=self.sp_model_kwargs,
clean_up_tokenization_spaces=clean_up_tokenization_spaces,
add_prefix_space=add_prefix_space,
legacy=legacy,
use_default_system_prompt=use_default_system_prompt,
chat_template=chat_template,
**kwargs,
)
def __getstate__(self):
state = self.__dict__.copy()
state["sp_model"] = None
return state
def __setstate__(self, d):
self.__dict__ = d
self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
self.sp_model.Load(self.vocab_file)
@property
def vocab_size(self) -> int:
"""Returns the vocabulary size."""
return self.sp_model.get_piece_size()
def get_vocab(self) -> Dict[str, int]:
"""Returns the vocabulary as a dictionary of token to index."""
vocab = {self.convert_ids_to_tokens(i): i for i in range(self.vocab_size)}
vocab.update(self.added_tokens_encoder)
return vocab
def _tokenize(self, text: str) -> List[str]:
"""
Tokenize a string.
Args:
text (`str`): The text to tokenize.
Returns:
`List[str]`: The list of tokens.
"""
if self.add_prefix_space:
text = " " + text
if self.legacy:
return self.sp_model.encode(text, out_type=str)
# Non-legacy behavior: handle special tokens properly
return self.sp_model.encode(text, out_type=str)
def _convert_token_to_id(self, token: str) -> int:
"""Converts a token (str) to an id using the vocab."""
return self.sp_model.piece_to_id(token)
def _convert_id_to_token(self, index: int) -> str:
"""Converts an index (integer) to a token (str) using the vocab."""
token = self.sp_model.IdToPiece(index)
return token
def convert_tokens_to_string(self, tokens: List[str]) -> str:
"""
Converts a sequence of tokens (strings) to a single string.
This method handles special tokens separately to ensure they are not
decoded using the SentencePiece model.
Args:
tokens (`List[str]`): The list of tokens to convert.
Returns:
`str`: The decoded string.
"""
current_sub_tokens = []
out_string = ""
prev_is_special = False
for i, token in enumerate(tokens):
# make sure that special tokens are not decoded using sentencepiece model
if token in self.all_special_tokens:
if not prev_is_special and i != 0:
out_string += " "
out_string += self.sp_model.decode(current_sub_tokens) + token
prev_is_special = True
current_sub_tokens = []
else:
current_sub_tokens.append(token)
prev_is_special = False
out_string += self.sp_model.decode(current_sub_tokens)
return out_string
def save_vocabulary(self, save_directory: str, filename_prefix: Optional[str] = None) -> Tuple[str]:
"""
Save the vocabulary and special tokens file to a directory.
Args:
save_directory (`str`):
The directory in which to save the vocabulary.
filename_prefix (`str`, *optional*):
An optional prefix to add to the named of the saved files.
Returns:
`Tuple(str)`: Paths to the files saved.
"""
if not os.path.isdir(save_directory):
logger.error(f"Vocabulary path ({save_directory}) should be a directory")
return
out_vocab_file = os.path.join(
save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
)
if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file) and os.path.isfile(self.vocab_file):
copyfile(self.vocab_file, out_vocab_file)
elif not os.path.isfile(self.vocab_file):
with open(out_vocab_file, "wb") as fi:
content_spiece_model = self.sp_model.serialized_model_proto()
fi.write(content_spiece_model)
return (out_vocab_file,)
def build_inputs_with_special_tokens(
self,
token_ids_0: List[int],
token_ids_1: Optional[List[int]] = None
) -> List[int]:
"""
Build model inputs from a sequence or a pair of sequences for sequence classification tasks by concatenating
and adding special tokens.
An IQuestCoder sequence has the following format:
- single sequence: `<s> X </s>` (if add_eos_token is True) or `<s> X` (default)
- pair of sequences: `<s> A </s> <s> B </s>` (if add_eos_token is True) or `<s> A <s> B` (default)
Args:
token_ids_0 (`List[int]`):
List of IDs to which the special tokens will be added.
token_ids_1 (`List[int]`, *optional*):
Optional second list of IDs for sequence pairs.
Returns:
`List[int]`: List of input IDs with the appropriate special tokens.
"""
bos_token_id = [self.bos_token_id] if self.add_bos_token else []
eos_token_id = [self.eos_token_id] if self.add_eos_token else []
output = bos_token_id + token_ids_0 + eos_token_id
if token_ids_1 is not None:
output = output + bos_token_id + token_ids_1 + eos_token_id
return output
def get_special_tokens_mask(
self,
token_ids_0: List[int],
token_ids_1: Optional[List[int]] = None,
already_has_special_tokens: bool = False
) -> List[int]:
"""
Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `prepare_for_model` method.
Args:
token_ids_0 (`List[int]`):
List of IDs.
token_ids_1 (`List[int]`, *optional*):
Optional second list of IDs for sequence pairs.
already_has_special_tokens (`bool`, *optional*, defaults to `False`):
Whether or not the token list is already formatted with special tokens for the model.
Returns:
`List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
"""
if already_has_special_tokens:
return super().get_special_tokens_mask(
token_ids_0=token_ids_0, token_ids_1=token_ids_1, already_has_special_tokens=True
)
bos_token_id = [1] if self.add_bos_token else []
eos_token_id = [1] if self.add_eos_token else []
if token_ids_1 is None:
return bos_token_id + ([0] * len(token_ids_0)) + eos_token_id
return (
bos_token_id
+ ([0] * len(token_ids_0))
+ eos_token_id
+ bos_token_id
+ ([0] * len(token_ids_1))
+ eos_token_id
)
def create_token_type_ids_from_sequences(
self,
token_ids_0: List[int],
token_ids_1: Optional[List[int]] = None
) -> List[int]:
"""
Create a mask from the two sequences passed to be used in a sequence-pair classification task.
An IQuestCoder sequence pair mask has the following format:
```
0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence | second sequence |
```
If `token_ids_1` is `None`, this method only returns the first portion of the mask (0s).
Args:
token_ids_0 (`List[int]`):
List of IDs.
token_ids_1 (`List[int]`, *optional*):
Optional second list of IDs for sequence pairs.
Returns:
`List[int]`: List of token type IDs according to the given sequence(s).
"""
bos_token_id = [self.bos_token_id] if self.add_bos_token else []
eos_token_id = [self.eos_token_id] if self.add_eos_token else []
output = [0] * len(bos_token_id + token_ids_0 + eos_token_id)
if token_ids_1 is not None:
output += [1] * len(bos_token_id + token_ids_1 + eos_token_id)
return output
@property
def default_chat_template(self) -> str:
"""
Returns the default chat template for IQuestCoder.
This template formats conversations with system, user, and assistant roles.
"""
return DEFAULT_CHAT_TEMPLATE
def apply_chat_template(
self,
conversation: Union[List[Dict[str, str]], "Conversation"],
chat_template: Optional[str] = None,
add_generation_prompt: bool = False,
tokenize: bool = True,
padding: bool = False,
truncation: bool = False,
max_length: Optional[int] = None,
return_tensors: Optional[str] = None,
return_dict: bool = False,
**tokenizer_kwargs,
):
"""
Apply a chat template to format a conversation.
Args:
conversation (`List[Dict[str, str]]` or `Conversation`):
A list of dicts with "role" and "content" keys, representing the conversation history.
chat_template (`str`, *optional*):
A Jinja template to use for formatting. If not provided, the tokenizer's default will be used.
add_generation_prompt (`bool`, *optional*, defaults to `False`):
Whether to add a generation prompt at the end for the assistant to continue.
tokenize (`bool`, *optional*, defaults to `True`):
Whether to tokenize the output. If `False`, returns a string.
padding (`bool`, *optional*, defaults to `False`):
Whether to pad sequences.
truncation (`bool`, *optional*, defaults to `False`):
Whether to truncate sequences.
max_length (`int`, *optional*):
Maximum length of the output.
return_tensors (`str`, *optional*):
The type of tensors to return ("pt", "tf", "np", or None).
return_dict (`bool`, *optional*, defaults to `False`):
Whether to return a dictionary with additional information.
**tokenizer_kwargs:
Additional keyword arguments passed to the tokenizer.
Returns:
`Union[str, List[int], BatchEncoding]`: The formatted (and optionally tokenized) conversation.
Example:
```python
>>> tokenizer = IQuestCoderTokenizer.from_pretrained("path/to/model")
>>> conversation = [
... {"role": "system", "content": "You are a helpful assistant."},
... {"role": "user", "content": "Hello!"},
... {"role": "assistant", "content": "Hi there! How can I help you today?"},
... {"role": "user", "content": "What's the weather like?"},
... ]
>>> tokenizer.apply_chat_template(conversation, add_generation_prompt=True, tokenize=False)
'<|system|>\\nYou are a helpful assistant.\\n</|system|><|user|>\\nHello!\\n</|user|>...'
```
"""
# Use parent class implementation with our template
return super().apply_chat_template(
conversation,
chat_template=chat_template,
add_generation_prompt=add_generation_prompt,
tokenize=tokenize,
padding=padding,
truncation=truncation,
max_length=max_length,
return_tensors=return_tensors,
return_dict=return_dict,
**tokenizer_kwargs,
)
# Try to import and create Fast tokenizer version
try:
from transformers import PreTrainedTokenizerFast
from tokenizers import Tokenizer, decoders, models, normalizers, pre_tokenizers, processors
class IQuestCoderTokenizerFast(PreTrainedTokenizerFast):
"""
Construct a "fast" IQuestCoder tokenizer (backed by HuggingFace's *tokenizers* library).
This is a fast implementation of [`IQuestCoderTokenizer`] using the 🤗 Tokenizers library.
Args:
vocab_file (`str`, *optional*):
Path to the vocabulary file (SentencePiece model).
tokenizer_file (`str`, *optional*):
Path to a tokenizer JSON file.
unk_token (`str`, *optional*, defaults to `"<unk>"`):
The unknown token.
bos_token (`str`, *optional*, defaults to `"<s>"`):
The beginning of sequence token.
eos_token (`str`, *optional*, defaults to `"</s>"`):
The end of sequence token.
pad_token (`str`, *optional*):
The token used for padding.
add_bos_token (`bool`, *optional*, defaults to `True`):
Whether to add a BOS token at the start of sequences.
add_eos_token (`bool`, *optional*, defaults to `False`):
Whether to add an EOS token at the end of sequences.
add_prefix_space (`bool`, *optional*, defaults to `False`):
Whether to add an initial space to the input.
use_default_system_prompt (`bool`, *optional*, defaults to `False`):
Whether to use the default system prompt.
chat_template (`str`, *optional*):
A Jinja template for formatting conversations.
Example:
```python
>>> from tokenization_iquestcoder import IQuestCoderTokenizerFast
>>> tokenizer = IQuestCoderTokenizerFast.from_pretrained("path/to/model")
>>> tokenizer.encode("Hello, world!")
[1, 15043, 29892, 3186, 29991]
```
"""
vocab_files_names = VOCAB_FILES_NAMES
pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP
max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
model_input_names = ["input_ids", "attention_mask"]
slow_tokenizer_class = IQuestCoderTokenizer
def __init__(
self,
vocab_file=None,
tokenizer_file=None,
unk_token="<unk>",
bos_token="<s>",
eos_token="</s>",
pad_token=None,
add_bos_token=True,
add_eos_token=False,
add_prefix_space=False,
use_default_system_prompt=False,
chat_template=None,
**kwargs,
):
self.add_bos_token = add_bos_token
self.add_eos_token = add_eos_token
self.add_prefix_space = add_prefix_space
self.use_default_system_prompt = use_default_system_prompt
if chat_template is None:
chat_template = DEFAULT_CHAT_TEMPLATE
super().__init__(
vocab_file=vocab_file,
tokenizer_file=tokenizer_file,
unk_token=unk_token,
bos_token=bos_token,
eos_token=eos_token,
pad_token=pad_token,
add_bos_token=add_bos_token,
add_eos_token=add_eos_token,
add_prefix_space=add_prefix_space,
use_default_system_prompt=use_default_system_prompt,
chat_template=chat_template,
**kwargs,
)
@property
def can_save_slow_tokenizer(self) -> bool:
return os.path.isfile(self.vocab_file) if self.vocab_file else False
@property
def default_chat_template(self) -> str:
"""Returns the default chat template."""
return DEFAULT_CHAT_TEMPLATE
def build_inputs_with_special_tokens(
self,
token_ids_0: List[int],
token_ids_1: Optional[List[int]] = None
) -> List[int]:
"""Build model inputs with special tokens."""
bos_token_id = [self.bos_token_id] if self.add_bos_token else []
eos_token_id = [self.eos_token_id] if self.add_eos_token else []
output = bos_token_id + token_ids_0 + eos_token_id
if token_ids_1 is not None:
output = output + bos_token_id + token_ids_1 + eos_token_id
return output
def get_special_tokens_mask(
self,
token_ids_0: List[int],
token_ids_1: Optional[List[int]] = None,
already_has_special_tokens: bool = False
) -> List[int]:
"""Retrieve special tokens mask."""
if already_has_special_tokens:
return super().get_special_tokens_mask(
token_ids_0=token_ids_0, token_ids_1=token_ids_1, already_has_special_tokens=True
)
bos_token_id = [1] if self.add_bos_token else []
eos_token_id = [1] if self.add_eos_token else []
if token_ids_1 is None:
return bos_token_id + ([0] * len(token_ids_0)) + eos_token_id
return (
bos_token_id
+ ([0] * len(token_ids_0))
+ eos_token_id
+ bos_token_id
+ ([0] * len(token_ids_1))
+ eos_token_id
)
def create_token_type_ids_from_sequences(
self,
token_ids_0: List[int],
token_ids_1: Optional[List[int]] = None
) -> List[int]:
"""Create token type IDs from sequences."""
bos_token_id = [self.bos_token_id] if self.add_bos_token else []
eos_token_id = [self.eos_token_id] if self.add_eos_token else []
output = [0] * len(bos_token_id + token_ids_0 + eos_token_id)
if token_ids_1 is not None:
output += [1] * len(bos_token_id + token_ids_1 + eos_token_id)
return output
except ImportError:
# tokenizers library not available, Fast tokenizer not supported
IQuestCoderTokenizerFast = None
logger.info(
"The `tokenizers` library is not installed. "
"IQuestCoderTokenizerFast will not be available. "
"Install it with `pip install tokenizers`."
)

3
tokenizer.model Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7d3be68e090a927f31e0e378d7599b15c206dd47e4a73933775a746cc9c1cd91
size 1345108

240
tokenizer_config.json Normal file
View File

@@ -0,0 +1,240 @@
{
"add_bos_token": false,
"add_eos_token": false,
"added_tokens_decoder": {
"0": {
"content": "<unk>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": true,
"special": true
},
"1": {
"content": "<s>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "</s>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": true,
"special": true
},
"75858": {
"content": "<CLS>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75859": {
"content": "<SEP>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75860": {
"content": "<EOD>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75861": {
"content": "<MASK>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75862": {
"content": "<PAD>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75863": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75864": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75865": {
"content": "<|fim_prefix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75866": {
"content": "<|fim_middle|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75867": {
"content": "<|fim_suffix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75868": {
"content": "<|fim_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75869": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75870": {
"content": "<|repo_name|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75871": {
"content": "<|file_sep|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"75872": {
"content": "<think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"75873": {
"content": "</think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"75874": {
"content": "<tools>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"75875": {
"content": "</tools>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"75876": {
"content": "<tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"75877": {
"content": "</tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"75878": {
"content": "<tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"75879": {
"content": "</tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
}
},
"additional_special_tokens": [
"<|CLS|>",
"<|SEP|>",
"<|EOD|>",
"<|MASK|>",
"<|PAD|>",
"<|fim_prefix|>",
"<|fim_middle|>",
"<|fim_suffix|>",
"<|im_start|>",
"<|im_end|>",
"<|fim_pad|>",
"<|endoftext|>",
"<|repo_name|>",
"<|file_sep|>"
],
"auto_map": {
"AutoTokenizer": [
"tokenization_iquestcoder.IQuestCoderTokenizer",
null
]
},
"bos_token": "<s>",
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- else %}\n {{- 'You are IndustrialCoder, a helpful assistant developed by Beihang University.' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou have access to the following functions:\\n\\n<tools>\" }}\n {%- for tool in tools %}\n {%- if tool.type == 'function' and tool.function %}\n {%- set func = tool.function %}\n {%- else %}\n {%- set func = tool %}\n {%- endif %}\n {{- \"\\n<function>\\n<name>\" + func.name + \"</name>\" }}\n {%- if func.description %}\n {{- \"\\n<description>\" + func.description + \"</description>\" }}\n {%- endif %}\n {{- \"\\n<parameters>\" }}\n {%- if func.parameters and func.parameters.properties %}\n {%- for param_name, param_fields in func.parameters.properties.items() %}\n {{- \"\\n<parameter>\" }}\n {{- \"\\n<name>\" + param_name + \"</name>\" }}\n {%- if param_fields.type %}\n {{- \"\\n<type>\" + param_fields.type + \"</type>\" }}\n {%- endif %}\n {%- if param_fields.description %}\n {{- \"\\n<description>\" + param_fields.description + \"</description>\" }}\n {%- endif %}\n {{- \"\\n</parameter>\" }}\n {%- endfor %}\n {%- endif %}\n {{- \"\\n</parameters>\\n</function>\" }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nIf you choose to call a function ONLY reply in the following format:\\n\\n<tool_call>\\n<function=example_function_name>\\n<parameter=example_parameter_1>\\nvalue_1\\n</parameter>\\n</function>\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are IndustrialCoder, a helpful assistant developed by Beihang University.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set content = message.content %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tc = tool_call.function %}\n {%- else %}\n {%- set tc = tool_call %}\n {%- endif %}\n {{- '<tool_call>\\n<function=' + tc.name + '>\\n' }}\n {%- if tc.arguments is string %}\n {%- set args = tc.arguments | fromjson %}\n {%- else %}\n {%- set args = tc.arguments %}\n {%- endif %}\n {%- for arg_name, arg_value in args.items() %}\n {{- '<parameter=' + arg_name + '>\\n' }}\n {%- if arg_value is string %}\n {{- arg_value }}\n {%- else %}\n {{- arg_value | tojson }}\n {%- endif %}\n {{- '\\n</parameter>\\n' }}\n {%- endfor %}\n {{- '</function>\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}",
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"model_max_length": 131072,
"pad_token": "<|endoftext|>",
"padding_side": "right",
"sp_model_kwargs": {},
"split_special_tokens": false,
"tokenizer_class": "IQuestCoderTokenizer",
"unk_token": "<unk>",
"use_fast": false
}