Instructions to use AlphaOxO/GPT-X2.5-125M-8bits-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use AlphaOxO/GPT-X2.5-125M-8bits-mlx with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("AlphaOxO/GPT-X2.5-125M-8bits-mlx") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use AlphaOxO/GPT-X2.5-125M-8bits-mlx with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "AlphaOxO/GPT-X2.5-125M-8bits-mlx" --prompt "Once upon a time"
- Atomic Chat
Upload folder using huggingface_hub
Browse files- README.md +7 -0
- __init__.py +1 -0
- config.json +41 -0
- configuration_gptx2.py +40 -0
- export_to_hf.py +62 -0
- generation_config.json +9 -0
- model.safetensors +3 -0
- model.safetensors.index.json +702 -0
- modeling_gptx2.py +255 -0
- tokenizer.json +0 -0
- tokenizer_config.json +18 -0
- usage.py +22 -0
README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
library_name: mlx
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- mlx
|
| 7 |
+
---
|
__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
"""GPT-X2.5 Hugging Face model package."""
|
config.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"GPTX2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_type": "grouped_query",
|
| 6 |
+
"auto_map": {
|
| 7 |
+
"AutoConfig": "configuration_gptx2.GPTX2Config",
|
| 8 |
+
"AutoModelForCausalLM": "modeling_gptx2.GPTX2ForCausalLM"
|
| 9 |
+
},
|
| 10 |
+
"bias": false,
|
| 11 |
+
"bos_token_id": 0,
|
| 12 |
+
"embedding_scale": false,
|
| 13 |
+
"eos_token_id": 0,
|
| 14 |
+
"head_dim": 64,
|
| 15 |
+
"hidden_act": "silu",
|
| 16 |
+
"hidden_size": 576,
|
| 17 |
+
"intermediate_size": 1728,
|
| 18 |
+
"max_position_embeddings": 8192,
|
| 19 |
+
"model_type": "gptx2",
|
| 20 |
+
"num_attention_heads": 9,
|
| 21 |
+
"num_hidden_layers": 30,
|
| 22 |
+
"num_key_value_heads": 3,
|
| 23 |
+
"pad_token_id": 1,
|
| 24 |
+
"qk_norm": false,
|
| 25 |
+
"quantization": {
|
| 26 |
+
"group_size": 64,
|
| 27 |
+
"bits": 8,
|
| 28 |
+
"mode": "affine"
|
| 29 |
+
},
|
| 30 |
+
"quantization_config": {
|
| 31 |
+
"group_size": 64,
|
| 32 |
+
"bits": 8,
|
| 33 |
+
"mode": "affine"
|
| 34 |
+
},
|
| 35 |
+
"rms_norm_eps": 1e-06,
|
| 36 |
+
"rope_theta": 100000.0,
|
| 37 |
+
"tie_word_embeddings": true,
|
| 38 |
+
"torch_dtype": "float32",
|
| 39 |
+
"vocab_size": 32770,
|
| 40 |
+
"xsa_projection": true
|
| 41 |
+
}
|
configuration_gptx2.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""GPT-X2.5 model configuration."""
|
| 2 |
+
|
| 3 |
+
from transformers import PretrainedConfig
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class GPTX2Config(PretrainedConfig):
|
| 7 |
+
model_type = "gptx2"
|
| 8 |
+
|
| 9 |
+
def __init__(
|
| 10 |
+
self,
|
| 11 |
+
vocab_size=32770,
|
| 12 |
+
hidden_size=576,
|
| 13 |
+
num_hidden_layers=30,
|
| 14 |
+
num_attention_heads=9,
|
| 15 |
+
num_key_value_heads=3,
|
| 16 |
+
head_dim=64,
|
| 17 |
+
intermediate_size=1728,
|
| 18 |
+
max_position_embeddings=8192,
|
| 19 |
+
rope_theta=100000.0,
|
| 20 |
+
rms_norm_eps=1e-6,
|
| 21 |
+
tie_word_embeddings=True,
|
| 22 |
+
xsa_projection=True,
|
| 23 |
+
qk_norm=False,
|
| 24 |
+
embedding_scale=False,
|
| 25 |
+
**kwargs,
|
| 26 |
+
):
|
| 27 |
+
self.vocab_size = vocab_size
|
| 28 |
+
self.hidden_size = hidden_size
|
| 29 |
+
self.num_hidden_layers = num_hidden_layers
|
| 30 |
+
self.num_attention_heads = num_attention_heads
|
| 31 |
+
self.num_key_value_heads = num_key_value_heads
|
| 32 |
+
self.head_dim = head_dim
|
| 33 |
+
self.intermediate_size = intermediate_size
|
| 34 |
+
self.max_position_embeddings = max_position_embeddings
|
| 35 |
+
self.rope_theta = rope_theta
|
| 36 |
+
self.rms_norm_eps = rms_norm_eps
|
| 37 |
+
self.xsa_projection = xsa_projection
|
| 38 |
+
self.qk_norm = qk_norm
|
| 39 |
+
self.embedding_scale = embedding_scale
|
| 40 |
+
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
|
export_to_hf.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Convert the final GPT-X2.5 training checkpoint to Hugging Face SafeTensors."""
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
|
| 6 |
+
import torch
|
| 7 |
+
from safetensors.torch import save_file
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
EXPECTED_TENSORS = 273
|
| 11 |
+
EXPECTED_UNIQUE_PARAMETERS = 135_032_256
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def main():
|
| 15 |
+
parser = argparse.ArgumentParser()
|
| 16 |
+
parser.add_argument("checkpoint", type=Path, help="Training .pt checkpoint")
|
| 17 |
+
parser.add_argument("--output", type=Path, default=Path("model.safetensors"))
|
| 18 |
+
parser.add_argument(
|
| 19 |
+
"--dtype", choices=("bfloat16", "float16", "float32"), default="float32"
|
| 20 |
+
)
|
| 21 |
+
args = parser.parse_args()
|
| 22 |
+
|
| 23 |
+
checkpoint = torch.load(
|
| 24 |
+
args.checkpoint, map_location="cpu", weights_only=False, mmap=True
|
| 25 |
+
)
|
| 26 |
+
if "model" not in checkpoint:
|
| 27 |
+
raise KeyError("Checkpoint does not contain a 'model' state dictionary")
|
| 28 |
+
state = checkpoint["model"]
|
| 29 |
+
if len(state) != EXPECTED_TENSORS:
|
| 30 |
+
raise ValueError(f"Expected {EXPECTED_TENSORS} tensors, found {len(state)}")
|
| 31 |
+
if not torch.equal(state["transformer.wte.weight"], state["lm_head.weight"]):
|
| 32 |
+
raise ValueError("Tied embedding and LM-head tensors differ")
|
| 33 |
+
|
| 34 |
+
# Hugging Face restores lm_head.weight from the tied embedding. SafeTensors
|
| 35 |
+
# intentionally stores the shared tensor only once.
|
| 36 |
+
state = {key: value for key, value in state.items() if key != "lm_head.weight"}
|
| 37 |
+
parameter_count = sum(tensor.numel() for tensor in state.values())
|
| 38 |
+
if parameter_count != EXPECTED_UNIQUE_PARAMETERS:
|
| 39 |
+
raise ValueError(
|
| 40 |
+
f"Expected {EXPECTED_UNIQUE_PARAMETERS:,} unique parameters, "
|
| 41 |
+
f"found {parameter_count:,}"
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
dtype = getattr(torch, args.dtype)
|
| 45 |
+
converted = {
|
| 46 |
+
key: tensor.detach().to(dtype=dtype).contiguous() for key, tensor in state.items()
|
| 47 |
+
}
|
| 48 |
+
args.output.parent.mkdir(parents=True, exist_ok=True)
|
| 49 |
+
save_file(
|
| 50 |
+
converted,
|
| 51 |
+
str(args.output),
|
| 52 |
+
metadata={"format": "pt", "source_step": str(checkpoint.get("step", "unknown"))},
|
| 53 |
+
)
|
| 54 |
+
print(
|
| 55 |
+
f"Saved {args.output} ({parameter_count:,} parameters, {args.dtype}, "
|
| 56 |
+
f"step {checkpoint.get('step', 'unknown')})"
|
| 57 |
+
)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
if __name__ == "__main__":
|
| 61 |
+
main()
|
| 62 |
+
|
generation_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 0,
|
| 3 |
+
"eos_token_id": 0,
|
| 4 |
+
"pad_token_id": 1,
|
| 5 |
+
"do_sample": true,
|
| 6 |
+
"temperature": 0.8,
|
| 7 |
+
"top_p": 0.95,
|
| 8 |
+
"top_k": 50
|
| 9 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:85997330dbd2f8241a4cc113f5a9ba0d967897256277bfb32968a2595d66e9ea
|
| 3 |
+
size 152080932
|
model.safetensors.index.json
ADDED
|
@@ -0,0 +1,702 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"metadata": {
|
| 3 |
+
"total_size": 152012304,
|
| 4 |
+
"total_parameters": 135032256
|
| 5 |
+
},
|
| 6 |
+
"weight_map": {
|
| 7 |
+
"model.h.0.attn.k_proj.biases": "model.safetensors",
|
| 8 |
+
"model.h.0.attn.k_proj.scales": "model.safetensors",
|
| 9 |
+
"model.h.0.attn.k_proj.weight": "model.safetensors",
|
| 10 |
+
"model.h.0.attn.o_proj.biases": "model.safetensors",
|
| 11 |
+
"model.h.0.attn.o_proj.scales": "model.safetensors",
|
| 12 |
+
"model.h.0.attn.o_proj.weight": "model.safetensors",
|
| 13 |
+
"model.h.0.attn.q_proj.biases": "model.safetensors",
|
| 14 |
+
"model.h.0.attn.q_proj.scales": "model.safetensors",
|
| 15 |
+
"model.h.0.attn.q_proj.weight": "model.safetensors",
|
| 16 |
+
"model.h.0.attn.v_proj.biases": "model.safetensors",
|
| 17 |
+
"model.h.0.attn.v_proj.scales": "model.safetensors",
|
| 18 |
+
"model.h.0.attn.v_proj.weight": "model.safetensors",
|
| 19 |
+
"model.h.0.ln_1.weight": "model.safetensors",
|
| 20 |
+
"model.h.0.ln_2.weight": "model.safetensors",
|
| 21 |
+
"model.h.0.mlp.w_down.biases": "model.safetensors",
|
| 22 |
+
"model.h.0.mlp.w_down.scales": "model.safetensors",
|
| 23 |
+
"model.h.0.mlp.w_down.weight": "model.safetensors",
|
| 24 |
+
"model.h.0.mlp.w_gate.biases": "model.safetensors",
|
| 25 |
+
"model.h.0.mlp.w_gate.scales": "model.safetensors",
|
| 26 |
+
"model.h.0.mlp.w_gate.weight": "model.safetensors",
|
| 27 |
+
"model.h.0.mlp.w_up.biases": "model.safetensors",
|
| 28 |
+
"model.h.0.mlp.w_up.scales": "model.safetensors",
|
| 29 |
+
"model.h.0.mlp.w_up.weight": "model.safetensors",
|
| 30 |
+
"model.h.1.attn.k_proj.biases": "model.safetensors",
|
| 31 |
+
"model.h.1.attn.k_proj.scales": "model.safetensors",
|
| 32 |
+
"model.h.1.attn.k_proj.weight": "model.safetensors",
|
| 33 |
+
"model.h.1.attn.o_proj.biases": "model.safetensors",
|
| 34 |
+
"model.h.1.attn.o_proj.scales": "model.safetensors",
|
| 35 |
+
"model.h.1.attn.o_proj.weight": "model.safetensors",
|
| 36 |
+
"model.h.1.attn.q_proj.biases": "model.safetensors",
|
| 37 |
+
"model.h.1.attn.q_proj.scales": "model.safetensors",
|
| 38 |
+
"model.h.1.attn.q_proj.weight": "model.safetensors",
|
| 39 |
+
"model.h.1.attn.v_proj.biases": "model.safetensors",
|
| 40 |
+
"model.h.1.attn.v_proj.scales": "model.safetensors",
|
| 41 |
+
"model.h.1.attn.v_proj.weight": "model.safetensors",
|
| 42 |
+
"model.h.1.ln_1.weight": "model.safetensors",
|
| 43 |
+
"model.h.1.ln_2.weight": "model.safetensors",
|
| 44 |
+
"model.h.1.mlp.w_down.biases": "model.safetensors",
|
| 45 |
+
"model.h.1.mlp.w_down.scales": "model.safetensors",
|
| 46 |
+
"model.h.1.mlp.w_down.weight": "model.safetensors",
|
| 47 |
+
"model.h.1.mlp.w_gate.biases": "model.safetensors",
|
| 48 |
+
"model.h.1.mlp.w_gate.scales": "model.safetensors",
|
| 49 |
+
"model.h.1.mlp.w_gate.weight": "model.safetensors",
|
| 50 |
+
"model.h.1.mlp.w_up.biases": "model.safetensors",
|
| 51 |
+
"model.h.1.mlp.w_up.scales": "model.safetensors",
|
| 52 |
+
"model.h.1.mlp.w_up.weight": "model.safetensors",
|
| 53 |
+
"model.h.10.attn.k_proj.biases": "model.safetensors",
|
| 54 |
+
"model.h.10.attn.k_proj.scales": "model.safetensors",
|
| 55 |
+
"model.h.10.attn.k_proj.weight": "model.safetensors",
|
| 56 |
+
"model.h.10.attn.o_proj.biases": "model.safetensors",
|
| 57 |
+
"model.h.10.attn.o_proj.scales": "model.safetensors",
|
| 58 |
+
"model.h.10.attn.o_proj.weight": "model.safetensors",
|
| 59 |
+
"model.h.10.attn.q_proj.biases": "model.safetensors",
|
| 60 |
+
"model.h.10.attn.q_proj.scales": "model.safetensors",
|
| 61 |
+
"model.h.10.attn.q_proj.weight": "model.safetensors",
|
| 62 |
+
"model.h.10.attn.v_proj.biases": "model.safetensors",
|
| 63 |
+
"model.h.10.attn.v_proj.scales": "model.safetensors",
|
| 64 |
+
"model.h.10.attn.v_proj.weight": "model.safetensors",
|
| 65 |
+
"model.h.10.ln_1.weight": "model.safetensors",
|
| 66 |
+
"model.h.10.ln_2.weight": "model.safetensors",
|
| 67 |
+
"model.h.10.mlp.w_down.biases": "model.safetensors",
|
| 68 |
+
"model.h.10.mlp.w_down.scales": "model.safetensors",
|
| 69 |
+
"model.h.10.mlp.w_down.weight": "model.safetensors",
|
| 70 |
+
"model.h.10.mlp.w_gate.biases": "model.safetensors",
|
| 71 |
+
"model.h.10.mlp.w_gate.scales": "model.safetensors",
|
| 72 |
+
"model.h.10.mlp.w_gate.weight": "model.safetensors",
|
| 73 |
+
"model.h.10.mlp.w_up.biases": "model.safetensors",
|
| 74 |
+
"model.h.10.mlp.w_up.scales": "model.safetensors",
|
| 75 |
+
"model.h.10.mlp.w_up.weight": "model.safetensors",
|
| 76 |
+
"model.h.11.attn.k_proj.biases": "model.safetensors",
|
| 77 |
+
"model.h.11.attn.k_proj.scales": "model.safetensors",
|
| 78 |
+
"model.h.11.attn.k_proj.weight": "model.safetensors",
|
| 79 |
+
"model.h.11.attn.o_proj.biases": "model.safetensors",
|
| 80 |
+
"model.h.11.attn.o_proj.scales": "model.safetensors",
|
| 81 |
+
"model.h.11.attn.o_proj.weight": "model.safetensors",
|
| 82 |
+
"model.h.11.attn.q_proj.biases": "model.safetensors",
|
| 83 |
+
"model.h.11.attn.q_proj.scales": "model.safetensors",
|
| 84 |
+
"model.h.11.attn.q_proj.weight": "model.safetensors",
|
| 85 |
+
"model.h.11.attn.v_proj.biases": "model.safetensors",
|
| 86 |
+
"model.h.11.attn.v_proj.scales": "model.safetensors",
|
| 87 |
+
"model.h.11.attn.v_proj.weight": "model.safetensors",
|
| 88 |
+
"model.h.11.ln_1.weight": "model.safetensors",
|
| 89 |
+
"model.h.11.ln_2.weight": "model.safetensors",
|
| 90 |
+
"model.h.11.mlp.w_down.biases": "model.safetensors",
|
| 91 |
+
"model.h.11.mlp.w_down.scales": "model.safetensors",
|
| 92 |
+
"model.h.11.mlp.w_down.weight": "model.safetensors",
|
| 93 |
+
"model.h.11.mlp.w_gate.biases": "model.safetensors",
|
| 94 |
+
"model.h.11.mlp.w_gate.scales": "model.safetensors",
|
| 95 |
+
"model.h.11.mlp.w_gate.weight": "model.safetensors",
|
| 96 |
+
"model.h.11.mlp.w_up.biases": "model.safetensors",
|
| 97 |
+
"model.h.11.mlp.w_up.scales": "model.safetensors",
|
| 98 |
+
"model.h.11.mlp.w_up.weight": "model.safetensors",
|
| 99 |
+
"model.h.12.attn.k_proj.biases": "model.safetensors",
|
| 100 |
+
"model.h.12.attn.k_proj.scales": "model.safetensors",
|
| 101 |
+
"model.h.12.attn.k_proj.weight": "model.safetensors",
|
| 102 |
+
"model.h.12.attn.o_proj.biases": "model.safetensors",
|
| 103 |
+
"model.h.12.attn.o_proj.scales": "model.safetensors",
|
| 104 |
+
"model.h.12.attn.o_proj.weight": "model.safetensors",
|
| 105 |
+
"model.h.12.attn.q_proj.biases": "model.safetensors",
|
| 106 |
+
"model.h.12.attn.q_proj.scales": "model.safetensors",
|
| 107 |
+
"model.h.12.attn.q_proj.weight": "model.safetensors",
|
| 108 |
+
"model.h.12.attn.v_proj.biases": "model.safetensors",
|
| 109 |
+
"model.h.12.attn.v_proj.scales": "model.safetensors",
|
| 110 |
+
"model.h.12.attn.v_proj.weight": "model.safetensors",
|
| 111 |
+
"model.h.12.ln_1.weight": "model.safetensors",
|
| 112 |
+
"model.h.12.ln_2.weight": "model.safetensors",
|
| 113 |
+
"model.h.12.mlp.w_down.biases": "model.safetensors",
|
| 114 |
+
"model.h.12.mlp.w_down.scales": "model.safetensors",
|
| 115 |
+
"model.h.12.mlp.w_down.weight": "model.safetensors",
|
| 116 |
+
"model.h.12.mlp.w_gate.biases": "model.safetensors",
|
| 117 |
+
"model.h.12.mlp.w_gate.scales": "model.safetensors",
|
| 118 |
+
"model.h.12.mlp.w_gate.weight": "model.safetensors",
|
| 119 |
+
"model.h.12.mlp.w_up.biases": "model.safetensors",
|
| 120 |
+
"model.h.12.mlp.w_up.scales": "model.safetensors",
|
| 121 |
+
"model.h.12.mlp.w_up.weight": "model.safetensors",
|
| 122 |
+
"model.h.13.attn.k_proj.biases": "model.safetensors",
|
| 123 |
+
"model.h.13.attn.k_proj.scales": "model.safetensors",
|
| 124 |
+
"model.h.13.attn.k_proj.weight": "model.safetensors",
|
| 125 |
+
"model.h.13.attn.o_proj.biases": "model.safetensors",
|
| 126 |
+
"model.h.13.attn.o_proj.scales": "model.safetensors",
|
| 127 |
+
"model.h.13.attn.o_proj.weight": "model.safetensors",
|
| 128 |
+
"model.h.13.attn.q_proj.biases": "model.safetensors",
|
| 129 |
+
"model.h.13.attn.q_proj.scales": "model.safetensors",
|
| 130 |
+
"model.h.13.attn.q_proj.weight": "model.safetensors",
|
| 131 |
+
"model.h.13.attn.v_proj.biases": "model.safetensors",
|
| 132 |
+
"model.h.13.attn.v_proj.scales": "model.safetensors",
|
| 133 |
+
"model.h.13.attn.v_proj.weight": "model.safetensors",
|
| 134 |
+
"model.h.13.ln_1.weight": "model.safetensors",
|
| 135 |
+
"model.h.13.ln_2.weight": "model.safetensors",
|
| 136 |
+
"model.h.13.mlp.w_down.biases": "model.safetensors",
|
| 137 |
+
"model.h.13.mlp.w_down.scales": "model.safetensors",
|
| 138 |
+
"model.h.13.mlp.w_down.weight": "model.safetensors",
|
| 139 |
+
"model.h.13.mlp.w_gate.biases": "model.safetensors",
|
| 140 |
+
"model.h.13.mlp.w_gate.scales": "model.safetensors",
|
| 141 |
+
"model.h.13.mlp.w_gate.weight": "model.safetensors",
|
| 142 |
+
"model.h.13.mlp.w_up.biases": "model.safetensors",
|
| 143 |
+
"model.h.13.mlp.w_up.scales": "model.safetensors",
|
| 144 |
+
"model.h.13.mlp.w_up.weight": "model.safetensors",
|
| 145 |
+
"model.h.14.attn.k_proj.biases": "model.safetensors",
|
| 146 |
+
"model.h.14.attn.k_proj.scales": "model.safetensors",
|
| 147 |
+
"model.h.14.attn.k_proj.weight": "model.safetensors",
|
| 148 |
+
"model.h.14.attn.o_proj.biases": "model.safetensors",
|
| 149 |
+
"model.h.14.attn.o_proj.scales": "model.safetensors",
|
| 150 |
+
"model.h.14.attn.o_proj.weight": "model.safetensors",
|
| 151 |
+
"model.h.14.attn.q_proj.biases": "model.safetensors",
|
| 152 |
+
"model.h.14.attn.q_proj.scales": "model.safetensors",
|
| 153 |
+
"model.h.14.attn.q_proj.weight": "model.safetensors",
|
| 154 |
+
"model.h.14.attn.v_proj.biases": "model.safetensors",
|
| 155 |
+
"model.h.14.attn.v_proj.scales": "model.safetensors",
|
| 156 |
+
"model.h.14.attn.v_proj.weight": "model.safetensors",
|
| 157 |
+
"model.h.14.ln_1.weight": "model.safetensors",
|
| 158 |
+
"model.h.14.ln_2.weight": "model.safetensors",
|
| 159 |
+
"model.h.14.mlp.w_down.biases": "model.safetensors",
|
| 160 |
+
"model.h.14.mlp.w_down.scales": "model.safetensors",
|
| 161 |
+
"model.h.14.mlp.w_down.weight": "model.safetensors",
|
| 162 |
+
"model.h.14.mlp.w_gate.biases": "model.safetensors",
|
| 163 |
+
"model.h.14.mlp.w_gate.scales": "model.safetensors",
|
| 164 |
+
"model.h.14.mlp.w_gate.weight": "model.safetensors",
|
| 165 |
+
"model.h.14.mlp.w_up.biases": "model.safetensors",
|
| 166 |
+
"model.h.14.mlp.w_up.scales": "model.safetensors",
|
| 167 |
+
"model.h.14.mlp.w_up.weight": "model.safetensors",
|
| 168 |
+
"model.h.15.attn.k_proj.biases": "model.safetensors",
|
| 169 |
+
"model.h.15.attn.k_proj.scales": "model.safetensors",
|
| 170 |
+
"model.h.15.attn.k_proj.weight": "model.safetensors",
|
| 171 |
+
"model.h.15.attn.o_proj.biases": "model.safetensors",
|
| 172 |
+
"model.h.15.attn.o_proj.scales": "model.safetensors",
|
| 173 |
+
"model.h.15.attn.o_proj.weight": "model.safetensors",
|
| 174 |
+
"model.h.15.attn.q_proj.biases": "model.safetensors",
|
| 175 |
+
"model.h.15.attn.q_proj.scales": "model.safetensors",
|
| 176 |
+
"model.h.15.attn.q_proj.weight": "model.safetensors",
|
| 177 |
+
"model.h.15.attn.v_proj.biases": "model.safetensors",
|
| 178 |
+
"model.h.15.attn.v_proj.scales": "model.safetensors",
|
| 179 |
+
"model.h.15.attn.v_proj.weight": "model.safetensors",
|
| 180 |
+
"model.h.15.ln_1.weight": "model.safetensors",
|
| 181 |
+
"model.h.15.ln_2.weight": "model.safetensors",
|
| 182 |
+
"model.h.15.mlp.w_down.biases": "model.safetensors",
|
| 183 |
+
"model.h.15.mlp.w_down.scales": "model.safetensors",
|
| 184 |
+
"model.h.15.mlp.w_down.weight": "model.safetensors",
|
| 185 |
+
"model.h.15.mlp.w_gate.biases": "model.safetensors",
|
| 186 |
+
"model.h.15.mlp.w_gate.scales": "model.safetensors",
|
| 187 |
+
"model.h.15.mlp.w_gate.weight": "model.safetensors",
|
| 188 |
+
"model.h.15.mlp.w_up.biases": "model.safetensors",
|
| 189 |
+
"model.h.15.mlp.w_up.scales": "model.safetensors",
|
| 190 |
+
"model.h.15.mlp.w_up.weight": "model.safetensors",
|
| 191 |
+
"model.h.16.attn.k_proj.biases": "model.safetensors",
|
| 192 |
+
"model.h.16.attn.k_proj.scales": "model.safetensors",
|
| 193 |
+
"model.h.16.attn.k_proj.weight": "model.safetensors",
|
| 194 |
+
"model.h.16.attn.o_proj.biases": "model.safetensors",
|
| 195 |
+
"model.h.16.attn.o_proj.scales": "model.safetensors",
|
| 196 |
+
"model.h.16.attn.o_proj.weight": "model.safetensors",
|
| 197 |
+
"model.h.16.attn.q_proj.biases": "model.safetensors",
|
| 198 |
+
"model.h.16.attn.q_proj.scales": "model.safetensors",
|
| 199 |
+
"model.h.16.attn.q_proj.weight": "model.safetensors",
|
| 200 |
+
"model.h.16.attn.v_proj.biases": "model.safetensors",
|
| 201 |
+
"model.h.16.attn.v_proj.scales": "model.safetensors",
|
| 202 |
+
"model.h.16.attn.v_proj.weight": "model.safetensors",
|
| 203 |
+
"model.h.16.ln_1.weight": "model.safetensors",
|
| 204 |
+
"model.h.16.ln_2.weight": "model.safetensors",
|
| 205 |
+
"model.h.16.mlp.w_down.biases": "model.safetensors",
|
| 206 |
+
"model.h.16.mlp.w_down.scales": "model.safetensors",
|
| 207 |
+
"model.h.16.mlp.w_down.weight": "model.safetensors",
|
| 208 |
+
"model.h.16.mlp.w_gate.biases": "model.safetensors",
|
| 209 |
+
"model.h.16.mlp.w_gate.scales": "model.safetensors",
|
| 210 |
+
"model.h.16.mlp.w_gate.weight": "model.safetensors",
|
| 211 |
+
"model.h.16.mlp.w_up.biases": "model.safetensors",
|
| 212 |
+
"model.h.16.mlp.w_up.scales": "model.safetensors",
|
| 213 |
+
"model.h.16.mlp.w_up.weight": "model.safetensors",
|
| 214 |
+
"model.h.17.attn.k_proj.biases": "model.safetensors",
|
| 215 |
+
"model.h.17.attn.k_proj.scales": "model.safetensors",
|
| 216 |
+
"model.h.17.attn.k_proj.weight": "model.safetensors",
|
| 217 |
+
"model.h.17.attn.o_proj.biases": "model.safetensors",
|
| 218 |
+
"model.h.17.attn.o_proj.scales": "model.safetensors",
|
| 219 |
+
"model.h.17.attn.o_proj.weight": "model.safetensors",
|
| 220 |
+
"model.h.17.attn.q_proj.biases": "model.safetensors",
|
| 221 |
+
"model.h.17.attn.q_proj.scales": "model.safetensors",
|
| 222 |
+
"model.h.17.attn.q_proj.weight": "model.safetensors",
|
| 223 |
+
"model.h.17.attn.v_proj.biases": "model.safetensors",
|
| 224 |
+
"model.h.17.attn.v_proj.scales": "model.safetensors",
|
| 225 |
+
"model.h.17.attn.v_proj.weight": "model.safetensors",
|
| 226 |
+
"model.h.17.ln_1.weight": "model.safetensors",
|
| 227 |
+
"model.h.17.ln_2.weight": "model.safetensors",
|
| 228 |
+
"model.h.17.mlp.w_down.biases": "model.safetensors",
|
| 229 |
+
"model.h.17.mlp.w_down.scales": "model.safetensors",
|
| 230 |
+
"model.h.17.mlp.w_down.weight": "model.safetensors",
|
| 231 |
+
"model.h.17.mlp.w_gate.biases": "model.safetensors",
|
| 232 |
+
"model.h.17.mlp.w_gate.scales": "model.safetensors",
|
| 233 |
+
"model.h.17.mlp.w_gate.weight": "model.safetensors",
|
| 234 |
+
"model.h.17.mlp.w_up.biases": "model.safetensors",
|
| 235 |
+
"model.h.17.mlp.w_up.scales": "model.safetensors",
|
| 236 |
+
"model.h.17.mlp.w_up.weight": "model.safetensors",
|
| 237 |
+
"model.h.18.attn.k_proj.biases": "model.safetensors",
|
| 238 |
+
"model.h.18.attn.k_proj.scales": "model.safetensors",
|
| 239 |
+
"model.h.18.attn.k_proj.weight": "model.safetensors",
|
| 240 |
+
"model.h.18.attn.o_proj.biases": "model.safetensors",
|
| 241 |
+
"model.h.18.attn.o_proj.scales": "model.safetensors",
|
| 242 |
+
"model.h.18.attn.o_proj.weight": "model.safetensors",
|
| 243 |
+
"model.h.18.attn.q_proj.biases": "model.safetensors",
|
| 244 |
+
"model.h.18.attn.q_proj.scales": "model.safetensors",
|
| 245 |
+
"model.h.18.attn.q_proj.weight": "model.safetensors",
|
| 246 |
+
"model.h.18.attn.v_proj.biases": "model.safetensors",
|
| 247 |
+
"model.h.18.attn.v_proj.scales": "model.safetensors",
|
| 248 |
+
"model.h.18.attn.v_proj.weight": "model.safetensors",
|
| 249 |
+
"model.h.18.ln_1.weight": "model.safetensors",
|
| 250 |
+
"model.h.18.ln_2.weight": "model.safetensors",
|
| 251 |
+
"model.h.18.mlp.w_down.biases": "model.safetensors",
|
| 252 |
+
"model.h.18.mlp.w_down.scales": "model.safetensors",
|
| 253 |
+
"model.h.18.mlp.w_down.weight": "model.safetensors",
|
| 254 |
+
"model.h.18.mlp.w_gate.biases": "model.safetensors",
|
| 255 |
+
"model.h.18.mlp.w_gate.scales": "model.safetensors",
|
| 256 |
+
"model.h.18.mlp.w_gate.weight": "model.safetensors",
|
| 257 |
+
"model.h.18.mlp.w_up.biases": "model.safetensors",
|
| 258 |
+
"model.h.18.mlp.w_up.scales": "model.safetensors",
|
| 259 |
+
"model.h.18.mlp.w_up.weight": "model.safetensors",
|
| 260 |
+
"model.h.19.attn.k_proj.biases": "model.safetensors",
|
| 261 |
+
"model.h.19.attn.k_proj.scales": "model.safetensors",
|
| 262 |
+
"model.h.19.attn.k_proj.weight": "model.safetensors",
|
| 263 |
+
"model.h.19.attn.o_proj.biases": "model.safetensors",
|
| 264 |
+
"model.h.19.attn.o_proj.scales": "model.safetensors",
|
| 265 |
+
"model.h.19.attn.o_proj.weight": "model.safetensors",
|
| 266 |
+
"model.h.19.attn.q_proj.biases": "model.safetensors",
|
| 267 |
+
"model.h.19.attn.q_proj.scales": "model.safetensors",
|
| 268 |
+
"model.h.19.attn.q_proj.weight": "model.safetensors",
|
| 269 |
+
"model.h.19.attn.v_proj.biases": "model.safetensors",
|
| 270 |
+
"model.h.19.attn.v_proj.scales": "model.safetensors",
|
| 271 |
+
"model.h.19.attn.v_proj.weight": "model.safetensors",
|
| 272 |
+
"model.h.19.ln_1.weight": "model.safetensors",
|
| 273 |
+
"model.h.19.ln_2.weight": "model.safetensors",
|
| 274 |
+
"model.h.19.mlp.w_down.biases": "model.safetensors",
|
| 275 |
+
"model.h.19.mlp.w_down.scales": "model.safetensors",
|
| 276 |
+
"model.h.19.mlp.w_down.weight": "model.safetensors",
|
| 277 |
+
"model.h.19.mlp.w_gate.biases": "model.safetensors",
|
| 278 |
+
"model.h.19.mlp.w_gate.scales": "model.safetensors",
|
| 279 |
+
"model.h.19.mlp.w_gate.weight": "model.safetensors",
|
| 280 |
+
"model.h.19.mlp.w_up.biases": "model.safetensors",
|
| 281 |
+
"model.h.19.mlp.w_up.scales": "model.safetensors",
|
| 282 |
+
"model.h.19.mlp.w_up.weight": "model.safetensors",
|
| 283 |
+
"model.h.2.attn.k_proj.biases": "model.safetensors",
|
| 284 |
+
"model.h.2.attn.k_proj.scales": "model.safetensors",
|
| 285 |
+
"model.h.2.attn.k_proj.weight": "model.safetensors",
|
| 286 |
+
"model.h.2.attn.o_proj.biases": "model.safetensors",
|
| 287 |
+
"model.h.2.attn.o_proj.scales": "model.safetensors",
|
| 288 |
+
"model.h.2.attn.o_proj.weight": "model.safetensors",
|
| 289 |
+
"model.h.2.attn.q_proj.biases": "model.safetensors",
|
| 290 |
+
"model.h.2.attn.q_proj.scales": "model.safetensors",
|
| 291 |
+
"model.h.2.attn.q_proj.weight": "model.safetensors",
|
| 292 |
+
"model.h.2.attn.v_proj.biases": "model.safetensors",
|
| 293 |
+
"model.h.2.attn.v_proj.scales": "model.safetensors",
|
| 294 |
+
"model.h.2.attn.v_proj.weight": "model.safetensors",
|
| 295 |
+
"model.h.2.ln_1.weight": "model.safetensors",
|
| 296 |
+
"model.h.2.ln_2.weight": "model.safetensors",
|
| 297 |
+
"model.h.2.mlp.w_down.biases": "model.safetensors",
|
| 298 |
+
"model.h.2.mlp.w_down.scales": "model.safetensors",
|
| 299 |
+
"model.h.2.mlp.w_down.weight": "model.safetensors",
|
| 300 |
+
"model.h.2.mlp.w_gate.biases": "model.safetensors",
|
| 301 |
+
"model.h.2.mlp.w_gate.scales": "model.safetensors",
|
| 302 |
+
"model.h.2.mlp.w_gate.weight": "model.safetensors",
|
| 303 |
+
"model.h.2.mlp.w_up.biases": "model.safetensors",
|
| 304 |
+
"model.h.2.mlp.w_up.scales": "model.safetensors",
|
| 305 |
+
"model.h.2.mlp.w_up.weight": "model.safetensors",
|
| 306 |
+
"model.h.20.attn.k_proj.biases": "model.safetensors",
|
| 307 |
+
"model.h.20.attn.k_proj.scales": "model.safetensors",
|
| 308 |
+
"model.h.20.attn.k_proj.weight": "model.safetensors",
|
| 309 |
+
"model.h.20.attn.o_proj.biases": "model.safetensors",
|
| 310 |
+
"model.h.20.attn.o_proj.scales": "model.safetensors",
|
| 311 |
+
"model.h.20.attn.o_proj.weight": "model.safetensors",
|
| 312 |
+
"model.h.20.attn.q_proj.biases": "model.safetensors",
|
| 313 |
+
"model.h.20.attn.q_proj.scales": "model.safetensors",
|
| 314 |
+
"model.h.20.attn.q_proj.weight": "model.safetensors",
|
| 315 |
+
"model.h.20.attn.v_proj.biases": "model.safetensors",
|
| 316 |
+
"model.h.20.attn.v_proj.scales": "model.safetensors",
|
| 317 |
+
"model.h.20.attn.v_proj.weight": "model.safetensors",
|
| 318 |
+
"model.h.20.ln_1.weight": "model.safetensors",
|
| 319 |
+
"model.h.20.ln_2.weight": "model.safetensors",
|
| 320 |
+
"model.h.20.mlp.w_down.biases": "model.safetensors",
|
| 321 |
+
"model.h.20.mlp.w_down.scales": "model.safetensors",
|
| 322 |
+
"model.h.20.mlp.w_down.weight": "model.safetensors",
|
| 323 |
+
"model.h.20.mlp.w_gate.biases": "model.safetensors",
|
| 324 |
+
"model.h.20.mlp.w_gate.scales": "model.safetensors",
|
| 325 |
+
"model.h.20.mlp.w_gate.weight": "model.safetensors",
|
| 326 |
+
"model.h.20.mlp.w_up.biases": "model.safetensors",
|
| 327 |
+
"model.h.20.mlp.w_up.scales": "model.safetensors",
|
| 328 |
+
"model.h.20.mlp.w_up.weight": "model.safetensors",
|
| 329 |
+
"model.h.21.attn.k_proj.biases": "model.safetensors",
|
| 330 |
+
"model.h.21.attn.k_proj.scales": "model.safetensors",
|
| 331 |
+
"model.h.21.attn.k_proj.weight": "model.safetensors",
|
| 332 |
+
"model.h.21.attn.o_proj.biases": "model.safetensors",
|
| 333 |
+
"model.h.21.attn.o_proj.scales": "model.safetensors",
|
| 334 |
+
"model.h.21.attn.o_proj.weight": "model.safetensors",
|
| 335 |
+
"model.h.21.attn.q_proj.biases": "model.safetensors",
|
| 336 |
+
"model.h.21.attn.q_proj.scales": "model.safetensors",
|
| 337 |
+
"model.h.21.attn.q_proj.weight": "model.safetensors",
|
| 338 |
+
"model.h.21.attn.v_proj.biases": "model.safetensors",
|
| 339 |
+
"model.h.21.attn.v_proj.scales": "model.safetensors",
|
| 340 |
+
"model.h.21.attn.v_proj.weight": "model.safetensors",
|
| 341 |
+
"model.h.21.ln_1.weight": "model.safetensors",
|
| 342 |
+
"model.h.21.ln_2.weight": "model.safetensors",
|
| 343 |
+
"model.h.21.mlp.w_down.biases": "model.safetensors",
|
| 344 |
+
"model.h.21.mlp.w_down.scales": "model.safetensors",
|
| 345 |
+
"model.h.21.mlp.w_down.weight": "model.safetensors",
|
| 346 |
+
"model.h.21.mlp.w_gate.biases": "model.safetensors",
|
| 347 |
+
"model.h.21.mlp.w_gate.scales": "model.safetensors",
|
| 348 |
+
"model.h.21.mlp.w_gate.weight": "model.safetensors",
|
| 349 |
+
"model.h.21.mlp.w_up.biases": "model.safetensors",
|
| 350 |
+
"model.h.21.mlp.w_up.scales": "model.safetensors",
|
| 351 |
+
"model.h.21.mlp.w_up.weight": "model.safetensors",
|
| 352 |
+
"model.h.22.attn.k_proj.biases": "model.safetensors",
|
| 353 |
+
"model.h.22.attn.k_proj.scales": "model.safetensors",
|
| 354 |
+
"model.h.22.attn.k_proj.weight": "model.safetensors",
|
| 355 |
+
"model.h.22.attn.o_proj.biases": "model.safetensors",
|
| 356 |
+
"model.h.22.attn.o_proj.scales": "model.safetensors",
|
| 357 |
+
"model.h.22.attn.o_proj.weight": "model.safetensors",
|
| 358 |
+
"model.h.22.attn.q_proj.biases": "model.safetensors",
|
| 359 |
+
"model.h.22.attn.q_proj.scales": "model.safetensors",
|
| 360 |
+
"model.h.22.attn.q_proj.weight": "model.safetensors",
|
| 361 |
+
"model.h.22.attn.v_proj.biases": "model.safetensors",
|
| 362 |
+
"model.h.22.attn.v_proj.scales": "model.safetensors",
|
| 363 |
+
"model.h.22.attn.v_proj.weight": "model.safetensors",
|
| 364 |
+
"model.h.22.ln_1.weight": "model.safetensors",
|
| 365 |
+
"model.h.22.ln_2.weight": "model.safetensors",
|
| 366 |
+
"model.h.22.mlp.w_down.biases": "model.safetensors",
|
| 367 |
+
"model.h.22.mlp.w_down.scales": "model.safetensors",
|
| 368 |
+
"model.h.22.mlp.w_down.weight": "model.safetensors",
|
| 369 |
+
"model.h.22.mlp.w_gate.biases": "model.safetensors",
|
| 370 |
+
"model.h.22.mlp.w_gate.scales": "model.safetensors",
|
| 371 |
+
"model.h.22.mlp.w_gate.weight": "model.safetensors",
|
| 372 |
+
"model.h.22.mlp.w_up.biases": "model.safetensors",
|
| 373 |
+
"model.h.22.mlp.w_up.scales": "model.safetensors",
|
| 374 |
+
"model.h.22.mlp.w_up.weight": "model.safetensors",
|
| 375 |
+
"model.h.23.attn.k_proj.biases": "model.safetensors",
|
| 376 |
+
"model.h.23.attn.k_proj.scales": "model.safetensors",
|
| 377 |
+
"model.h.23.attn.k_proj.weight": "model.safetensors",
|
| 378 |
+
"model.h.23.attn.o_proj.biases": "model.safetensors",
|
| 379 |
+
"model.h.23.attn.o_proj.scales": "model.safetensors",
|
| 380 |
+
"model.h.23.attn.o_proj.weight": "model.safetensors",
|
| 381 |
+
"model.h.23.attn.q_proj.biases": "model.safetensors",
|
| 382 |
+
"model.h.23.attn.q_proj.scales": "model.safetensors",
|
| 383 |
+
"model.h.23.attn.q_proj.weight": "model.safetensors",
|
| 384 |
+
"model.h.23.attn.v_proj.biases": "model.safetensors",
|
| 385 |
+
"model.h.23.attn.v_proj.scales": "model.safetensors",
|
| 386 |
+
"model.h.23.attn.v_proj.weight": "model.safetensors",
|
| 387 |
+
"model.h.23.ln_1.weight": "model.safetensors",
|
| 388 |
+
"model.h.23.ln_2.weight": "model.safetensors",
|
| 389 |
+
"model.h.23.mlp.w_down.biases": "model.safetensors",
|
| 390 |
+
"model.h.23.mlp.w_down.scales": "model.safetensors",
|
| 391 |
+
"model.h.23.mlp.w_down.weight": "model.safetensors",
|
| 392 |
+
"model.h.23.mlp.w_gate.biases": "model.safetensors",
|
| 393 |
+
"model.h.23.mlp.w_gate.scales": "model.safetensors",
|
| 394 |
+
"model.h.23.mlp.w_gate.weight": "model.safetensors",
|
| 395 |
+
"model.h.23.mlp.w_up.biases": "model.safetensors",
|
| 396 |
+
"model.h.23.mlp.w_up.scales": "model.safetensors",
|
| 397 |
+
"model.h.23.mlp.w_up.weight": "model.safetensors",
|
| 398 |
+
"model.h.24.attn.k_proj.biases": "model.safetensors",
|
| 399 |
+
"model.h.24.attn.k_proj.scales": "model.safetensors",
|
| 400 |
+
"model.h.24.attn.k_proj.weight": "model.safetensors",
|
| 401 |
+
"model.h.24.attn.o_proj.biases": "model.safetensors",
|
| 402 |
+
"model.h.24.attn.o_proj.scales": "model.safetensors",
|
| 403 |
+
"model.h.24.attn.o_proj.weight": "model.safetensors",
|
| 404 |
+
"model.h.24.attn.q_proj.biases": "model.safetensors",
|
| 405 |
+
"model.h.24.attn.q_proj.scales": "model.safetensors",
|
| 406 |
+
"model.h.24.attn.q_proj.weight": "model.safetensors",
|
| 407 |
+
"model.h.24.attn.v_proj.biases": "model.safetensors",
|
| 408 |
+
"model.h.24.attn.v_proj.scales": "model.safetensors",
|
| 409 |
+
"model.h.24.attn.v_proj.weight": "model.safetensors",
|
| 410 |
+
"model.h.24.ln_1.weight": "model.safetensors",
|
| 411 |
+
"model.h.24.ln_2.weight": "model.safetensors",
|
| 412 |
+
"model.h.24.mlp.w_down.biases": "model.safetensors",
|
| 413 |
+
"model.h.24.mlp.w_down.scales": "model.safetensors",
|
| 414 |
+
"model.h.24.mlp.w_down.weight": "model.safetensors",
|
| 415 |
+
"model.h.24.mlp.w_gate.biases": "model.safetensors",
|
| 416 |
+
"model.h.24.mlp.w_gate.scales": "model.safetensors",
|
| 417 |
+
"model.h.24.mlp.w_gate.weight": "model.safetensors",
|
| 418 |
+
"model.h.24.mlp.w_up.biases": "model.safetensors",
|
| 419 |
+
"model.h.24.mlp.w_up.scales": "model.safetensors",
|
| 420 |
+
"model.h.24.mlp.w_up.weight": "model.safetensors",
|
| 421 |
+
"model.h.25.attn.k_proj.biases": "model.safetensors",
|
| 422 |
+
"model.h.25.attn.k_proj.scales": "model.safetensors",
|
| 423 |
+
"model.h.25.attn.k_proj.weight": "model.safetensors",
|
| 424 |
+
"model.h.25.attn.o_proj.biases": "model.safetensors",
|
| 425 |
+
"model.h.25.attn.o_proj.scales": "model.safetensors",
|
| 426 |
+
"model.h.25.attn.o_proj.weight": "model.safetensors",
|
| 427 |
+
"model.h.25.attn.q_proj.biases": "model.safetensors",
|
| 428 |
+
"model.h.25.attn.q_proj.scales": "model.safetensors",
|
| 429 |
+
"model.h.25.attn.q_proj.weight": "model.safetensors",
|
| 430 |
+
"model.h.25.attn.v_proj.biases": "model.safetensors",
|
| 431 |
+
"model.h.25.attn.v_proj.scales": "model.safetensors",
|
| 432 |
+
"model.h.25.attn.v_proj.weight": "model.safetensors",
|
| 433 |
+
"model.h.25.ln_1.weight": "model.safetensors",
|
| 434 |
+
"model.h.25.ln_2.weight": "model.safetensors",
|
| 435 |
+
"model.h.25.mlp.w_down.biases": "model.safetensors",
|
| 436 |
+
"model.h.25.mlp.w_down.scales": "model.safetensors",
|
| 437 |
+
"model.h.25.mlp.w_down.weight": "model.safetensors",
|
| 438 |
+
"model.h.25.mlp.w_gate.biases": "model.safetensors",
|
| 439 |
+
"model.h.25.mlp.w_gate.scales": "model.safetensors",
|
| 440 |
+
"model.h.25.mlp.w_gate.weight": "model.safetensors",
|
| 441 |
+
"model.h.25.mlp.w_up.biases": "model.safetensors",
|
| 442 |
+
"model.h.25.mlp.w_up.scales": "model.safetensors",
|
| 443 |
+
"model.h.25.mlp.w_up.weight": "model.safetensors",
|
| 444 |
+
"model.h.26.attn.k_proj.biases": "model.safetensors",
|
| 445 |
+
"model.h.26.attn.k_proj.scales": "model.safetensors",
|
| 446 |
+
"model.h.26.attn.k_proj.weight": "model.safetensors",
|
| 447 |
+
"model.h.26.attn.o_proj.biases": "model.safetensors",
|
| 448 |
+
"model.h.26.attn.o_proj.scales": "model.safetensors",
|
| 449 |
+
"model.h.26.attn.o_proj.weight": "model.safetensors",
|
| 450 |
+
"model.h.26.attn.q_proj.biases": "model.safetensors",
|
| 451 |
+
"model.h.26.attn.q_proj.scales": "model.safetensors",
|
| 452 |
+
"model.h.26.attn.q_proj.weight": "model.safetensors",
|
| 453 |
+
"model.h.26.attn.v_proj.biases": "model.safetensors",
|
| 454 |
+
"model.h.26.attn.v_proj.scales": "model.safetensors",
|
| 455 |
+
"model.h.26.attn.v_proj.weight": "model.safetensors",
|
| 456 |
+
"model.h.26.ln_1.weight": "model.safetensors",
|
| 457 |
+
"model.h.26.ln_2.weight": "model.safetensors",
|
| 458 |
+
"model.h.26.mlp.w_down.biases": "model.safetensors",
|
| 459 |
+
"model.h.26.mlp.w_down.scales": "model.safetensors",
|
| 460 |
+
"model.h.26.mlp.w_down.weight": "model.safetensors",
|
| 461 |
+
"model.h.26.mlp.w_gate.biases": "model.safetensors",
|
| 462 |
+
"model.h.26.mlp.w_gate.scales": "model.safetensors",
|
| 463 |
+
"model.h.26.mlp.w_gate.weight": "model.safetensors",
|
| 464 |
+
"model.h.26.mlp.w_up.biases": "model.safetensors",
|
| 465 |
+
"model.h.26.mlp.w_up.scales": "model.safetensors",
|
| 466 |
+
"model.h.26.mlp.w_up.weight": "model.safetensors",
|
| 467 |
+
"model.h.27.attn.k_proj.biases": "model.safetensors",
|
| 468 |
+
"model.h.27.attn.k_proj.scales": "model.safetensors",
|
| 469 |
+
"model.h.27.attn.k_proj.weight": "model.safetensors",
|
| 470 |
+
"model.h.27.attn.o_proj.biases": "model.safetensors",
|
| 471 |
+
"model.h.27.attn.o_proj.scales": "model.safetensors",
|
| 472 |
+
"model.h.27.attn.o_proj.weight": "model.safetensors",
|
| 473 |
+
"model.h.27.attn.q_proj.biases": "model.safetensors",
|
| 474 |
+
"model.h.27.attn.q_proj.scales": "model.safetensors",
|
| 475 |
+
"model.h.27.attn.q_proj.weight": "model.safetensors",
|
| 476 |
+
"model.h.27.attn.v_proj.biases": "model.safetensors",
|
| 477 |
+
"model.h.27.attn.v_proj.scales": "model.safetensors",
|
| 478 |
+
"model.h.27.attn.v_proj.weight": "model.safetensors",
|
| 479 |
+
"model.h.27.ln_1.weight": "model.safetensors",
|
| 480 |
+
"model.h.27.ln_2.weight": "model.safetensors",
|
| 481 |
+
"model.h.27.mlp.w_down.biases": "model.safetensors",
|
| 482 |
+
"model.h.27.mlp.w_down.scales": "model.safetensors",
|
| 483 |
+
"model.h.27.mlp.w_down.weight": "model.safetensors",
|
| 484 |
+
"model.h.27.mlp.w_gate.biases": "model.safetensors",
|
| 485 |
+
"model.h.27.mlp.w_gate.scales": "model.safetensors",
|
| 486 |
+
"model.h.27.mlp.w_gate.weight": "model.safetensors",
|
| 487 |
+
"model.h.27.mlp.w_up.biases": "model.safetensors",
|
| 488 |
+
"model.h.27.mlp.w_up.scales": "model.safetensors",
|
| 489 |
+
"model.h.27.mlp.w_up.weight": "model.safetensors",
|
| 490 |
+
"model.h.28.attn.k_proj.biases": "model.safetensors",
|
| 491 |
+
"model.h.28.attn.k_proj.scales": "model.safetensors",
|
| 492 |
+
"model.h.28.attn.k_proj.weight": "model.safetensors",
|
| 493 |
+
"model.h.28.attn.o_proj.biases": "model.safetensors",
|
| 494 |
+
"model.h.28.attn.o_proj.scales": "model.safetensors",
|
| 495 |
+
"model.h.28.attn.o_proj.weight": "model.safetensors",
|
| 496 |
+
"model.h.28.attn.q_proj.biases": "model.safetensors",
|
| 497 |
+
"model.h.28.attn.q_proj.scales": "model.safetensors",
|
| 498 |
+
"model.h.28.attn.q_proj.weight": "model.safetensors",
|
| 499 |
+
"model.h.28.attn.v_proj.biases": "model.safetensors",
|
| 500 |
+
"model.h.28.attn.v_proj.scales": "model.safetensors",
|
| 501 |
+
"model.h.28.attn.v_proj.weight": "model.safetensors",
|
| 502 |
+
"model.h.28.ln_1.weight": "model.safetensors",
|
| 503 |
+
"model.h.28.ln_2.weight": "model.safetensors",
|
| 504 |
+
"model.h.28.mlp.w_down.biases": "model.safetensors",
|
| 505 |
+
"model.h.28.mlp.w_down.scales": "model.safetensors",
|
| 506 |
+
"model.h.28.mlp.w_down.weight": "model.safetensors",
|
| 507 |
+
"model.h.28.mlp.w_gate.biases": "model.safetensors",
|
| 508 |
+
"model.h.28.mlp.w_gate.scales": "model.safetensors",
|
| 509 |
+
"model.h.28.mlp.w_gate.weight": "model.safetensors",
|
| 510 |
+
"model.h.28.mlp.w_up.biases": "model.safetensors",
|
| 511 |
+
"model.h.28.mlp.w_up.scales": "model.safetensors",
|
| 512 |
+
"model.h.28.mlp.w_up.weight": "model.safetensors",
|
| 513 |
+
"model.h.29.attn.k_proj.biases": "model.safetensors",
|
| 514 |
+
"model.h.29.attn.k_proj.scales": "model.safetensors",
|
| 515 |
+
"model.h.29.attn.k_proj.weight": "model.safetensors",
|
| 516 |
+
"model.h.29.attn.o_proj.biases": "model.safetensors",
|
| 517 |
+
"model.h.29.attn.o_proj.scales": "model.safetensors",
|
| 518 |
+
"model.h.29.attn.o_proj.weight": "model.safetensors",
|
| 519 |
+
"model.h.29.attn.q_proj.biases": "model.safetensors",
|
| 520 |
+
"model.h.29.attn.q_proj.scales": "model.safetensors",
|
| 521 |
+
"model.h.29.attn.q_proj.weight": "model.safetensors",
|
| 522 |
+
"model.h.29.attn.v_proj.biases": "model.safetensors",
|
| 523 |
+
"model.h.29.attn.v_proj.scales": "model.safetensors",
|
| 524 |
+
"model.h.29.attn.v_proj.weight": "model.safetensors",
|
| 525 |
+
"model.h.29.ln_1.weight": "model.safetensors",
|
| 526 |
+
"model.h.29.ln_2.weight": "model.safetensors",
|
| 527 |
+
"model.h.29.mlp.w_down.biases": "model.safetensors",
|
| 528 |
+
"model.h.29.mlp.w_down.scales": "model.safetensors",
|
| 529 |
+
"model.h.29.mlp.w_down.weight": "model.safetensors",
|
| 530 |
+
"model.h.29.mlp.w_gate.biases": "model.safetensors",
|
| 531 |
+
"model.h.29.mlp.w_gate.scales": "model.safetensors",
|
| 532 |
+
"model.h.29.mlp.w_gate.weight": "model.safetensors",
|
| 533 |
+
"model.h.29.mlp.w_up.biases": "model.safetensors",
|
| 534 |
+
"model.h.29.mlp.w_up.scales": "model.safetensors",
|
| 535 |
+
"model.h.29.mlp.w_up.weight": "model.safetensors",
|
| 536 |
+
"model.h.3.attn.k_proj.biases": "model.safetensors",
|
| 537 |
+
"model.h.3.attn.k_proj.scales": "model.safetensors",
|
| 538 |
+
"model.h.3.attn.k_proj.weight": "model.safetensors",
|
| 539 |
+
"model.h.3.attn.o_proj.biases": "model.safetensors",
|
| 540 |
+
"model.h.3.attn.o_proj.scales": "model.safetensors",
|
| 541 |
+
"model.h.3.attn.o_proj.weight": "model.safetensors",
|
| 542 |
+
"model.h.3.attn.q_proj.biases": "model.safetensors",
|
| 543 |
+
"model.h.3.attn.q_proj.scales": "model.safetensors",
|
| 544 |
+
"model.h.3.attn.q_proj.weight": "model.safetensors",
|
| 545 |
+
"model.h.3.attn.v_proj.biases": "model.safetensors",
|
| 546 |
+
"model.h.3.attn.v_proj.scales": "model.safetensors",
|
| 547 |
+
"model.h.3.attn.v_proj.weight": "model.safetensors",
|
| 548 |
+
"model.h.3.ln_1.weight": "model.safetensors",
|
| 549 |
+
"model.h.3.ln_2.weight": "model.safetensors",
|
| 550 |
+
"model.h.3.mlp.w_down.biases": "model.safetensors",
|
| 551 |
+
"model.h.3.mlp.w_down.scales": "model.safetensors",
|
| 552 |
+
"model.h.3.mlp.w_down.weight": "model.safetensors",
|
| 553 |
+
"model.h.3.mlp.w_gate.biases": "model.safetensors",
|
| 554 |
+
"model.h.3.mlp.w_gate.scales": "model.safetensors",
|
| 555 |
+
"model.h.3.mlp.w_gate.weight": "model.safetensors",
|
| 556 |
+
"model.h.3.mlp.w_up.biases": "model.safetensors",
|
| 557 |
+
"model.h.3.mlp.w_up.scales": "model.safetensors",
|
| 558 |
+
"model.h.3.mlp.w_up.weight": "model.safetensors",
|
| 559 |
+
"model.h.4.attn.k_proj.biases": "model.safetensors",
|
| 560 |
+
"model.h.4.attn.k_proj.scales": "model.safetensors",
|
| 561 |
+
"model.h.4.attn.k_proj.weight": "model.safetensors",
|
| 562 |
+
"model.h.4.attn.o_proj.biases": "model.safetensors",
|
| 563 |
+
"model.h.4.attn.o_proj.scales": "model.safetensors",
|
| 564 |
+
"model.h.4.attn.o_proj.weight": "model.safetensors",
|
| 565 |
+
"model.h.4.attn.q_proj.biases": "model.safetensors",
|
| 566 |
+
"model.h.4.attn.q_proj.scales": "model.safetensors",
|
| 567 |
+
"model.h.4.attn.q_proj.weight": "model.safetensors",
|
| 568 |
+
"model.h.4.attn.v_proj.biases": "model.safetensors",
|
| 569 |
+
"model.h.4.attn.v_proj.scales": "model.safetensors",
|
| 570 |
+
"model.h.4.attn.v_proj.weight": "model.safetensors",
|
| 571 |
+
"model.h.4.ln_1.weight": "model.safetensors",
|
| 572 |
+
"model.h.4.ln_2.weight": "model.safetensors",
|
| 573 |
+
"model.h.4.mlp.w_down.biases": "model.safetensors",
|
| 574 |
+
"model.h.4.mlp.w_down.scales": "model.safetensors",
|
| 575 |
+
"model.h.4.mlp.w_down.weight": "model.safetensors",
|
| 576 |
+
"model.h.4.mlp.w_gate.biases": "model.safetensors",
|
| 577 |
+
"model.h.4.mlp.w_gate.scales": "model.safetensors",
|
| 578 |
+
"model.h.4.mlp.w_gate.weight": "model.safetensors",
|
| 579 |
+
"model.h.4.mlp.w_up.biases": "model.safetensors",
|
| 580 |
+
"model.h.4.mlp.w_up.scales": "model.safetensors",
|
| 581 |
+
"model.h.4.mlp.w_up.weight": "model.safetensors",
|
| 582 |
+
"model.h.5.attn.k_proj.biases": "model.safetensors",
|
| 583 |
+
"model.h.5.attn.k_proj.scales": "model.safetensors",
|
| 584 |
+
"model.h.5.attn.k_proj.weight": "model.safetensors",
|
| 585 |
+
"model.h.5.attn.o_proj.biases": "model.safetensors",
|
| 586 |
+
"model.h.5.attn.o_proj.scales": "model.safetensors",
|
| 587 |
+
"model.h.5.attn.o_proj.weight": "model.safetensors",
|
| 588 |
+
"model.h.5.attn.q_proj.biases": "model.safetensors",
|
| 589 |
+
"model.h.5.attn.q_proj.scales": "model.safetensors",
|
| 590 |
+
"model.h.5.attn.q_proj.weight": "model.safetensors",
|
| 591 |
+
"model.h.5.attn.v_proj.biases": "model.safetensors",
|
| 592 |
+
"model.h.5.attn.v_proj.scales": "model.safetensors",
|
| 593 |
+
"model.h.5.attn.v_proj.weight": "model.safetensors",
|
| 594 |
+
"model.h.5.ln_1.weight": "model.safetensors",
|
| 595 |
+
"model.h.5.ln_2.weight": "model.safetensors",
|
| 596 |
+
"model.h.5.mlp.w_down.biases": "model.safetensors",
|
| 597 |
+
"model.h.5.mlp.w_down.scales": "model.safetensors",
|
| 598 |
+
"model.h.5.mlp.w_down.weight": "model.safetensors",
|
| 599 |
+
"model.h.5.mlp.w_gate.biases": "model.safetensors",
|
| 600 |
+
"model.h.5.mlp.w_gate.scales": "model.safetensors",
|
| 601 |
+
"model.h.5.mlp.w_gate.weight": "model.safetensors",
|
| 602 |
+
"model.h.5.mlp.w_up.biases": "model.safetensors",
|
| 603 |
+
"model.h.5.mlp.w_up.scales": "model.safetensors",
|
| 604 |
+
"model.h.5.mlp.w_up.weight": "model.safetensors",
|
| 605 |
+
"model.h.6.attn.k_proj.biases": "model.safetensors",
|
| 606 |
+
"model.h.6.attn.k_proj.scales": "model.safetensors",
|
| 607 |
+
"model.h.6.attn.k_proj.weight": "model.safetensors",
|
| 608 |
+
"model.h.6.attn.o_proj.biases": "model.safetensors",
|
| 609 |
+
"model.h.6.attn.o_proj.scales": "model.safetensors",
|
| 610 |
+
"model.h.6.attn.o_proj.weight": "model.safetensors",
|
| 611 |
+
"model.h.6.attn.q_proj.biases": "model.safetensors",
|
| 612 |
+
"model.h.6.attn.q_proj.scales": "model.safetensors",
|
| 613 |
+
"model.h.6.attn.q_proj.weight": "model.safetensors",
|
| 614 |
+
"model.h.6.attn.v_proj.biases": "model.safetensors",
|
| 615 |
+
"model.h.6.attn.v_proj.scales": "model.safetensors",
|
| 616 |
+
"model.h.6.attn.v_proj.weight": "model.safetensors",
|
| 617 |
+
"model.h.6.ln_1.weight": "model.safetensors",
|
| 618 |
+
"model.h.6.ln_2.weight": "model.safetensors",
|
| 619 |
+
"model.h.6.mlp.w_down.biases": "model.safetensors",
|
| 620 |
+
"model.h.6.mlp.w_down.scales": "model.safetensors",
|
| 621 |
+
"model.h.6.mlp.w_down.weight": "model.safetensors",
|
| 622 |
+
"model.h.6.mlp.w_gate.biases": "model.safetensors",
|
| 623 |
+
"model.h.6.mlp.w_gate.scales": "model.safetensors",
|
| 624 |
+
"model.h.6.mlp.w_gate.weight": "model.safetensors",
|
| 625 |
+
"model.h.6.mlp.w_up.biases": "model.safetensors",
|
| 626 |
+
"model.h.6.mlp.w_up.scales": "model.safetensors",
|
| 627 |
+
"model.h.6.mlp.w_up.weight": "model.safetensors",
|
| 628 |
+
"model.h.7.attn.k_proj.biases": "model.safetensors",
|
| 629 |
+
"model.h.7.attn.k_proj.scales": "model.safetensors",
|
| 630 |
+
"model.h.7.attn.k_proj.weight": "model.safetensors",
|
| 631 |
+
"model.h.7.attn.o_proj.biases": "model.safetensors",
|
| 632 |
+
"model.h.7.attn.o_proj.scales": "model.safetensors",
|
| 633 |
+
"model.h.7.attn.o_proj.weight": "model.safetensors",
|
| 634 |
+
"model.h.7.attn.q_proj.biases": "model.safetensors",
|
| 635 |
+
"model.h.7.attn.q_proj.scales": "model.safetensors",
|
| 636 |
+
"model.h.7.attn.q_proj.weight": "model.safetensors",
|
| 637 |
+
"model.h.7.attn.v_proj.biases": "model.safetensors",
|
| 638 |
+
"model.h.7.attn.v_proj.scales": "model.safetensors",
|
| 639 |
+
"model.h.7.attn.v_proj.weight": "model.safetensors",
|
| 640 |
+
"model.h.7.ln_1.weight": "model.safetensors",
|
| 641 |
+
"model.h.7.ln_2.weight": "model.safetensors",
|
| 642 |
+
"model.h.7.mlp.w_down.biases": "model.safetensors",
|
| 643 |
+
"model.h.7.mlp.w_down.scales": "model.safetensors",
|
| 644 |
+
"model.h.7.mlp.w_down.weight": "model.safetensors",
|
| 645 |
+
"model.h.7.mlp.w_gate.biases": "model.safetensors",
|
| 646 |
+
"model.h.7.mlp.w_gate.scales": "model.safetensors",
|
| 647 |
+
"model.h.7.mlp.w_gate.weight": "model.safetensors",
|
| 648 |
+
"model.h.7.mlp.w_up.biases": "model.safetensors",
|
| 649 |
+
"model.h.7.mlp.w_up.scales": "model.safetensors",
|
| 650 |
+
"model.h.7.mlp.w_up.weight": "model.safetensors",
|
| 651 |
+
"model.h.8.attn.k_proj.biases": "model.safetensors",
|
| 652 |
+
"model.h.8.attn.k_proj.scales": "model.safetensors",
|
| 653 |
+
"model.h.8.attn.k_proj.weight": "model.safetensors",
|
| 654 |
+
"model.h.8.attn.o_proj.biases": "model.safetensors",
|
| 655 |
+
"model.h.8.attn.o_proj.scales": "model.safetensors",
|
| 656 |
+
"model.h.8.attn.o_proj.weight": "model.safetensors",
|
| 657 |
+
"model.h.8.attn.q_proj.biases": "model.safetensors",
|
| 658 |
+
"model.h.8.attn.q_proj.scales": "model.safetensors",
|
| 659 |
+
"model.h.8.attn.q_proj.weight": "model.safetensors",
|
| 660 |
+
"model.h.8.attn.v_proj.biases": "model.safetensors",
|
| 661 |
+
"model.h.8.attn.v_proj.scales": "model.safetensors",
|
| 662 |
+
"model.h.8.attn.v_proj.weight": "model.safetensors",
|
| 663 |
+
"model.h.8.ln_1.weight": "model.safetensors",
|
| 664 |
+
"model.h.8.ln_2.weight": "model.safetensors",
|
| 665 |
+
"model.h.8.mlp.w_down.biases": "model.safetensors",
|
| 666 |
+
"model.h.8.mlp.w_down.scales": "model.safetensors",
|
| 667 |
+
"model.h.8.mlp.w_down.weight": "model.safetensors",
|
| 668 |
+
"model.h.8.mlp.w_gate.biases": "model.safetensors",
|
| 669 |
+
"model.h.8.mlp.w_gate.scales": "model.safetensors",
|
| 670 |
+
"model.h.8.mlp.w_gate.weight": "model.safetensors",
|
| 671 |
+
"model.h.8.mlp.w_up.biases": "model.safetensors",
|
| 672 |
+
"model.h.8.mlp.w_up.scales": "model.safetensors",
|
| 673 |
+
"model.h.8.mlp.w_up.weight": "model.safetensors",
|
| 674 |
+
"model.h.9.attn.k_proj.biases": "model.safetensors",
|
| 675 |
+
"model.h.9.attn.k_proj.scales": "model.safetensors",
|
| 676 |
+
"model.h.9.attn.k_proj.weight": "model.safetensors",
|
| 677 |
+
"model.h.9.attn.o_proj.biases": "model.safetensors",
|
| 678 |
+
"model.h.9.attn.o_proj.scales": "model.safetensors",
|
| 679 |
+
"model.h.9.attn.o_proj.weight": "model.safetensors",
|
| 680 |
+
"model.h.9.attn.q_proj.biases": "model.safetensors",
|
| 681 |
+
"model.h.9.attn.q_proj.scales": "model.safetensors",
|
| 682 |
+
"model.h.9.attn.q_proj.weight": "model.safetensors",
|
| 683 |
+
"model.h.9.attn.v_proj.biases": "model.safetensors",
|
| 684 |
+
"model.h.9.attn.v_proj.scales": "model.safetensors",
|
| 685 |
+
"model.h.9.attn.v_proj.weight": "model.safetensors",
|
| 686 |
+
"model.h.9.ln_1.weight": "model.safetensors",
|
| 687 |
+
"model.h.9.ln_2.weight": "model.safetensors",
|
| 688 |
+
"model.h.9.mlp.w_down.biases": "model.safetensors",
|
| 689 |
+
"model.h.9.mlp.w_down.scales": "model.safetensors",
|
| 690 |
+
"model.h.9.mlp.w_down.weight": "model.safetensors",
|
| 691 |
+
"model.h.9.mlp.w_gate.biases": "model.safetensors",
|
| 692 |
+
"model.h.9.mlp.w_gate.scales": "model.safetensors",
|
| 693 |
+
"model.h.9.mlp.w_gate.weight": "model.safetensors",
|
| 694 |
+
"model.h.9.mlp.w_up.biases": "model.safetensors",
|
| 695 |
+
"model.h.9.mlp.w_up.scales": "model.safetensors",
|
| 696 |
+
"model.h.9.mlp.w_up.weight": "model.safetensors",
|
| 697 |
+
"model.ln_f.weight": "model.safetensors",
|
| 698 |
+
"model.wte.biases": "model.safetensors",
|
| 699 |
+
"model.wte.scales": "model.safetensors",
|
| 700 |
+
"model.wte.weight": "model.safetensors"
|
| 701 |
+
}
|
| 702 |
+
}
|
modeling_gptx2.py
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""GPT-X2.5 causal language model for Hugging Face Transformers."""
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
|
| 5 |
+
import torch
|
| 6 |
+
import torch.nn as nn
|
| 7 |
+
from torch.nn import functional as F
|
| 8 |
+
from transformers import PreTrainedModel
|
| 9 |
+
from transformers.cache_utils import DynamicCache
|
| 10 |
+
from transformers.generation.utils import GenerationMixin
|
| 11 |
+
from transformers.modeling_outputs import CausalLMOutputWithPast
|
| 12 |
+
|
| 13 |
+
from .configuration_gptx2 import GPTX2Config
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class RMSNorm(nn.Module):
|
| 17 |
+
def __init__(self, dim, eps=1e-6):
|
| 18 |
+
super().__init__()
|
| 19 |
+
self.eps = eps
|
| 20 |
+
self.weight = nn.Parameter(torch.ones(dim))
|
| 21 |
+
|
| 22 |
+
def forward(self, x):
|
| 23 |
+
rms = torch.rsqrt(x.float().pow(2).mean(-1, keepdim=True) + self.eps)
|
| 24 |
+
return (x.float() * rms).type_as(x) * self.weight
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def precompute_rope_cos_sin(head_dim, seq_len, theta=100000.0, device=None):
|
| 28 |
+
inv_freq = 1.0 / (
|
| 29 |
+
theta ** (torch.arange(0, head_dim, 2, dtype=torch.float32, device=device) / head_dim)
|
| 30 |
+
)
|
| 31 |
+
positions = torch.arange(seq_len, dtype=torch.float32, device=device)
|
| 32 |
+
freqs = torch.outer(positions, inv_freq)
|
| 33 |
+
return freqs.cos(), freqs.sin()
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def apply_rotary_emb(q, k, rope_cos, rope_sin):
|
| 37 |
+
cos = rope_cos.unsqueeze(0).unsqueeze(0)
|
| 38 |
+
sin = rope_sin.unsqueeze(0).unsqueeze(0)
|
| 39 |
+
|
| 40 |
+
q_float = q.float().reshape(*q.shape[:-1], -1, 2)
|
| 41 |
+
k_float = k.float().reshape(*k.shape[:-1], -1, 2)
|
| 42 |
+
q_even, q_odd = q_float.unbind(-1)
|
| 43 |
+
k_even, k_odd = k_float.unbind(-1)
|
| 44 |
+
|
| 45 |
+
q_out = torch.stack(
|
| 46 |
+
(q_even * cos - q_odd * sin, q_even * sin + q_odd * cos), dim=-1
|
| 47 |
+
).flatten(-2)
|
| 48 |
+
k_out = torch.stack(
|
| 49 |
+
(k_even * cos - k_odd * sin, k_even * sin + k_odd * cos), dim=-1
|
| 50 |
+
).flatten(-2)
|
| 51 |
+
return q_out.type_as(q), k_out.type_as(k)
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
class GPTX2Attention(nn.Module):
|
| 55 |
+
def __init__(self, config, layer_idx):
|
| 56 |
+
super().__init__()
|
| 57 |
+
self.layer_idx = layer_idx
|
| 58 |
+
self.n_head = config.num_attention_heads
|
| 59 |
+
self.n_kv_heads = config.num_key_value_heads
|
| 60 |
+
self.head_dim = config.head_dim
|
| 61 |
+
self.n_rep = self.n_head // self.n_kv_heads
|
| 62 |
+
self.xsa_projection = config.xsa_projection
|
| 63 |
+
|
| 64 |
+
self.q_proj = nn.Linear(config.hidden_size, self.n_head * self.head_dim, bias=False)
|
| 65 |
+
self.k_proj = nn.Linear(config.hidden_size, self.n_kv_heads * self.head_dim, bias=False)
|
| 66 |
+
self.v_proj = nn.Linear(config.hidden_size, self.n_kv_heads * self.head_dim, bias=False)
|
| 67 |
+
self.o_proj = nn.Linear(self.n_head * self.head_dim, config.hidden_size, bias=False)
|
| 68 |
+
self.o_proj.NANOGPT_SCALE_INIT = 1
|
| 69 |
+
|
| 70 |
+
def forward(self, x, rope_cos, rope_sin, past_key_value=None, attention_mask=None):
|
| 71 |
+
batch_size, query_length, _ = x.size()
|
| 72 |
+
q = self.q_proj(x).view(batch_size, query_length, self.n_head, self.head_dim).transpose(1, 2)
|
| 73 |
+
k = self.k_proj(x).view(batch_size, query_length, self.n_kv_heads, self.head_dim).transpose(1, 2)
|
| 74 |
+
v = self.v_proj(x).view(batch_size, query_length, self.n_kv_heads, self.head_dim).transpose(1, 2)
|
| 75 |
+
|
| 76 |
+
q, k = apply_rotary_emb(q, k, rope_cos, rope_sin)
|
| 77 |
+
current_v = v
|
| 78 |
+
if past_key_value is not None:
|
| 79 |
+
k, v = past_key_value.update(k, v, self.layer_idx)
|
| 80 |
+
|
| 81 |
+
key_length = k.size(2)
|
| 82 |
+
k_repeated = k.repeat_interleave(self.n_rep, dim=1)
|
| 83 |
+
v_repeated = v.repeat_interleave(self.n_rep, dim=1)
|
| 84 |
+
|
| 85 |
+
past_length = key_length - query_length
|
| 86 |
+
is_causal = query_length > 1 and past_length == 0
|
| 87 |
+
attn_mask = None
|
| 88 |
+
# An explicit causal mask is required for cached multi-token chunks and
|
| 89 |
+
# whenever a padding mask is present (the latter disables is_causal).
|
| 90 |
+
if query_length > 1 and (past_length > 0 or attention_mask is not None):
|
| 91 |
+
causal = torch.ones(
|
| 92 |
+
query_length, key_length, dtype=torch.bool, device=x.device
|
| 93 |
+
).tril(diagonal=past_length)
|
| 94 |
+
attn_mask = causal[None, None, :, :]
|
| 95 |
+
if attention_mask is not None:
|
| 96 |
+
key_padding = attention_mask[:, None, None, :key_length].to(torch.bool)
|
| 97 |
+
attn_mask = key_padding if attn_mask is None else (key_padding & attn_mask)
|
| 98 |
+
is_causal = False
|
| 99 |
+
|
| 100 |
+
y = F.scaled_dot_product_attention(
|
| 101 |
+
q, k_repeated, v_repeated, attn_mask=attn_mask, is_causal=is_causal
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
# XSA: remove each query-head output's component parallel to its
|
| 105 |
+
# corresponding current-token KV value. This exactly matches training.
|
| 106 |
+
if self.xsa_projection:
|
| 107 |
+
y = y.view(batch_size, self.n_kv_heads, self.n_rep, query_length, self.head_dim)
|
| 108 |
+
v_grouped = current_v.unsqueeze(2)
|
| 109 |
+
denominator = v_grouped.pow(2).sum(dim=-1, keepdim=True).clamp_min(1e-6)
|
| 110 |
+
y = y - ((y * v_grouped).sum(dim=-1, keepdim=True) / denominator) * v_grouped
|
| 111 |
+
y = y.view(batch_size, self.n_head, query_length, self.head_dim)
|
| 112 |
+
|
| 113 |
+
y = y.transpose(1, 2).contiguous().view(
|
| 114 |
+
batch_size, query_length, self.n_head * self.head_dim
|
| 115 |
+
)
|
| 116 |
+
return self.o_proj(y)
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
class GPTX2SwiGLUMLP(nn.Module):
|
| 120 |
+
def __init__(self, config):
|
| 121 |
+
super().__init__()
|
| 122 |
+
self.w_gate = nn.Linear(config.hidden_size, config.intermediate_size, bias=False)
|
| 123 |
+
self.w_up = nn.Linear(config.hidden_size, config.intermediate_size, bias=False)
|
| 124 |
+
self.w_down = nn.Linear(config.intermediate_size, config.hidden_size, bias=False)
|
| 125 |
+
self.w_down.NANOGPT_SCALE_INIT = 1
|
| 126 |
+
|
| 127 |
+
def forward(self, x):
|
| 128 |
+
return self.w_down(F.silu(self.w_gate(x)) * self.w_up(x))
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
class GPTX2Block(nn.Module):
|
| 132 |
+
def __init__(self, config, layer_idx):
|
| 133 |
+
super().__init__()
|
| 134 |
+
self.ln_1 = RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
| 135 |
+
self.attn = GPTX2Attention(config, layer_idx)
|
| 136 |
+
self.ln_2 = RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
| 137 |
+
self.mlp = GPTX2SwiGLUMLP(config)
|
| 138 |
+
|
| 139 |
+
def forward(self, x, rope_cos, rope_sin, past_key_value=None, attention_mask=None):
|
| 140 |
+
x = x + self.attn(
|
| 141 |
+
self.ln_1(x), rope_cos, rope_sin, past_key_value, attention_mask
|
| 142 |
+
)
|
| 143 |
+
return x + self.mlp(self.ln_2(x))
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
class GPTX2PreTrainedModel(PreTrainedModel):
|
| 147 |
+
config_class = GPTX2Config
|
| 148 |
+
base_model_prefix = "transformer"
|
| 149 |
+
supports_gradient_checkpointing = False
|
| 150 |
+
|
| 151 |
+
def _init_weights(self, module):
|
| 152 |
+
std = 0.02
|
| 153 |
+
if hasattr(module, "NANOGPT_SCALE_INIT"):
|
| 154 |
+
std *= 2 * self.config.num_hidden_layers**-0.5
|
| 155 |
+
if isinstance(module, nn.Linear):
|
| 156 |
+
nn.init.normal_(module.weight, mean=0.0, std=std)
|
| 157 |
+
elif isinstance(module, nn.Embedding):
|
| 158 |
+
nn.init.normal_(module.weight, mean=0.0, std=0.02)
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
class GPTX2ForCausalLM(GPTX2PreTrainedModel, GenerationMixin):
|
| 162 |
+
_tied_weights_keys = {"lm_head.weight": "transformer.wte.weight"}
|
| 163 |
+
|
| 164 |
+
def __init__(self, config):
|
| 165 |
+
super().__init__(config)
|
| 166 |
+
self.transformer = nn.ModuleDict(
|
| 167 |
+
{
|
| 168 |
+
"wte": nn.Embedding(config.vocab_size, config.hidden_size),
|
| 169 |
+
"h": nn.ModuleList(
|
| 170 |
+
[GPTX2Block(config, i) for i in range(config.num_hidden_layers)]
|
| 171 |
+
),
|
| 172 |
+
"ln_f": RMSNorm(config.hidden_size, eps=config.rms_norm_eps),
|
| 173 |
+
}
|
| 174 |
+
)
|
| 175 |
+
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
| 176 |
+
if config.tie_word_embeddings:
|
| 177 |
+
self.lm_head.weight = self.transformer["wte"].weight
|
| 178 |
+
self._rope_cache = None
|
| 179 |
+
self.post_init()
|
| 180 |
+
|
| 181 |
+
def get_input_embeddings(self):
|
| 182 |
+
return self.transformer["wte"]
|
| 183 |
+
|
| 184 |
+
def set_input_embeddings(self, value):
|
| 185 |
+
self.transformer["wte"] = value
|
| 186 |
+
|
| 187 |
+
def get_output_embeddings(self):
|
| 188 |
+
return self.lm_head
|
| 189 |
+
|
| 190 |
+
def set_output_embeddings(self, value):
|
| 191 |
+
self.lm_head = value
|
| 192 |
+
|
| 193 |
+
def prepare_inputs_for_generation(
|
| 194 |
+
self, input_ids, past_key_values=None, attention_mask=None, **kwargs
|
| 195 |
+
):
|
| 196 |
+
if past_key_values is not None and past_key_values.get_seq_length() > 0:
|
| 197 |
+
input_ids = input_ids[:, -1:]
|
| 198 |
+
return {
|
| 199 |
+
"input_ids": input_ids,
|
| 200 |
+
"attention_mask": attention_mask,
|
| 201 |
+
"past_key_values": past_key_values,
|
| 202 |
+
"use_cache": True,
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
def _get_rope(self, seq_len, device):
|
| 206 |
+
cache = self._rope_cache
|
| 207 |
+
if cache is None or cache[0].device != device or cache[0].size(0) < seq_len:
|
| 208 |
+
cache = precompute_rope_cos_sin(
|
| 209 |
+
self.config.head_dim, seq_len, self.config.rope_theta, device=device
|
| 210 |
+
)
|
| 211 |
+
self._rope_cache = cache
|
| 212 |
+
return cache[0][:seq_len], cache[1][:seq_len]
|
| 213 |
+
|
| 214 |
+
def forward(
|
| 215 |
+
self,
|
| 216 |
+
input_ids,
|
| 217 |
+
attention_mask=None,
|
| 218 |
+
labels=None,
|
| 219 |
+
past_key_values: Optional[DynamicCache] = None,
|
| 220 |
+
use_cache=False,
|
| 221 |
+
**kwargs,
|
| 222 |
+
):
|
| 223 |
+
_, query_length = input_ids.size()
|
| 224 |
+
if use_cache and past_key_values is None:
|
| 225 |
+
past_key_values = DynamicCache()
|
| 226 |
+
past_length = past_key_values.get_seq_length() if past_key_values is not None else 0
|
| 227 |
+
if past_length + query_length > self.config.max_position_embeddings:
|
| 228 |
+
raise ValueError(
|
| 229 |
+
f"Sequence length {past_length + query_length} exceeds "
|
| 230 |
+
f"max_position_embeddings={self.config.max_position_embeddings}"
|
| 231 |
+
)
|
| 232 |
+
|
| 233 |
+
x = self.transformer["wte"](input_ids)
|
| 234 |
+
rope_cos, rope_sin = self._get_rope(past_length + query_length, input_ids.device)
|
| 235 |
+
rope_cos = rope_cos[past_length:]
|
| 236 |
+
rope_sin = rope_sin[past_length:]
|
| 237 |
+
|
| 238 |
+
cache = past_key_values if use_cache else None
|
| 239 |
+
for block in self.transformer["h"]:
|
| 240 |
+
x = block(x, rope_cos, rope_sin, cache, attention_mask)
|
| 241 |
+
logits = self.lm_head(self.transformer["ln_f"](x))
|
| 242 |
+
|
| 243 |
+
loss = None
|
| 244 |
+
if labels is not None:
|
| 245 |
+
shift_logits = logits[..., :-1, :].contiguous()
|
| 246 |
+
shift_labels = labels[..., 1:].contiguous()
|
| 247 |
+
loss = F.cross_entropy(
|
| 248 |
+
shift_logits.view(-1, shift_logits.size(-1)), shift_labels.view(-1)
|
| 249 |
+
)
|
| 250 |
+
|
| 251 |
+
return CausalLMOutputWithPast(
|
| 252 |
+
loss=loss,
|
| 253 |
+
logits=logits,
|
| 254 |
+
past_key_values=past_key_values if use_cache else None,
|
| 255 |
+
)
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|endoftext|>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|endoftext|>",
|
| 7 |
+
"extra_special_tokens": [
|
| 8 |
+
"<|im_start|>",
|
| 9 |
+
"<|im_end|>"
|
| 10 |
+
],
|
| 11 |
+
"is_local": true,
|
| 12 |
+
"local_files_only": false,
|
| 13 |
+
"model_max_length": 8192,
|
| 14 |
+
"pad_token": "<|padding|>",
|
| 15 |
+
"tokenizer_class": "TokenizersBackend",
|
| 16 |
+
"unk_token": "<|endoftext|>",
|
| 17 |
+
"vocab_size": 32768
|
| 18 |
+
}
|
usage.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 2 |
+
import torch
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
model_name = "/Users/alpha/model/GPT-X2.5-135M"
|
| 6 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 7 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 8 |
+
model_name,
|
| 9 |
+
trust_remote_code=True,
|
| 10 |
+
dtype=torch.float32
|
| 11 |
+
)
|
| 12 |
+
|
| 13 |
+
prompt = "The main is"
|
| 14 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 15 |
+
with torch.inference_mode():
|
| 16 |
+
output = model.generate(
|
| 17 |
+
**inputs,
|
| 18 |
+
max_new_tokens=120,
|
| 19 |
+
temperature=0.8
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|