Upload folder using huggingface_hub
Browse files- README.md +75 -0
- chat_template.jinja +1 -0
- config.json +53 -0
- configuration_youtu.py +198 -0
- generation_config.json +11 -0
- model.safetensors +3 -0
- model.safetensors.index.json +911 -0
- modeling_youtu.py +610 -0
- tokenizer.json +0 -0
- tokenizer_config.json +17 -0
README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: tencent-youtu
|
| 4 |
+
tags:
|
| 5 |
+
- mlx
|
| 6 |
+
- apple-silicon
|
| 7 |
+
- tencent
|
| 8 |
+
- youtu
|
| 9 |
+
- reasoning
|
| 10 |
+
- mla
|
| 11 |
+
- 4-bit
|
| 12 |
+
base_model: tencent/Youtu-LLM-2B
|
| 13 |
+
library_name: mlx-lm
|
| 14 |
+
pipeline_tag: text-generation
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Youtu-LLM-2B 4-bit MLX
|
| 18 |
+
|
| 19 |
+
MLX-optimized 4-bit quantized version of [tencent/Youtu-LLM-2B](https://huggingface.co/tencent/Youtu-LLM-2B) for Apple Silicon.
|
| 20 |
+
|
| 21 |
+
## Quick Start
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
pip install mlx-lm
|
| 25 |
+
|
| 26 |
+
mlx_lm.generate \
|
| 27 |
+
--model mlx-community/Youtu-LLM-2B-4bit \
|
| 28 |
+
--prompt "Hello, what can you do?" \
|
| 29 |
+
--max-tokens 100
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
## Model Details
|
| 33 |
+
|
| 34 |
+
- **Base Model:** tencent/Youtu-LLM-2B
|
| 35 |
+
- **Parameters:** 1.96B
|
| 36 |
+
- **Quantization:** 4-bit (4.5 bits/weight)
|
| 37 |
+
- **Context:** 128K tokens
|
| 38 |
+
- **Architecture:** Dense MLA (Multi-head Latent Attention)
|
| 39 |
+
- **Framework:** MLX (Apple Silicon optimized)
|
| 40 |
+
|
| 41 |
+
## Performance
|
| 42 |
+
|
| 43 |
+
| Metric | Value |
|
| 44 |
+
|--------|-------|
|
| 45 |
+
| Size | 1.2GB |
|
| 46 |
+
| Speed | ~209 tokens/sec |
|
| 47 |
+
| Peak Memory | ~1.4GB |
|
| 48 |
+
|
| 49 |
+
## Features
|
| 50 |
+
|
| 51 |
+
- **Reasoning Mode:** Uses `<think>` tags for Chain of Thought
|
| 52 |
+
- **128K Context:** Long document understanding
|
| 53 |
+
- **Agentic:** Strong on SWE-Bench, GAIA benchmarks
|
| 54 |
+
- **Edge-friendly:** Runs on any Apple Silicon Mac
|
| 55 |
+
|
| 56 |
+
## Benchmarks (vs Qwen3-4B)
|
| 57 |
+
|
| 58 |
+
| Benchmark | Youtu-LLM-2B | Qwen3-4B |
|
| 59 |
+
|-----------|--------------|----------|
|
| 60 |
+
| HumanEval | **95.9%** | 95.4% |
|
| 61 |
+
| SWE-Bench | **17.7%** | 5.7% |
|
| 62 |
+
| GAIA | **33.9%** | 25.5% |
|
| 63 |
+
|
| 64 |
+
## Other Quantizations
|
| 65 |
+
|
| 66 |
+
- [Full precision](https://huggingface.co/mlx-community/Youtu-LLM-2B) (4.4GB)
|
| 67 |
+
- [4-bit](https://huggingface.co/mlx-community/Youtu-LLM-2B-4bit) (1.2GB)
|
| 68 |
+
|
| 69 |
+
## Technical Note
|
| 70 |
+
|
| 71 |
+
Converted using deepseek_v2 architecture mapping (compatible MLA implementation).
|
| 72 |
+
|
| 73 |
+
## License
|
| 74 |
+
|
| 75 |
+
See [original model license](https://huggingface.co/tencent/Youtu-LLM-2B/blob/main/LICENSE.txt).
|
chat_template.jinja
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_tool_message=false, first_tool_index=messages|length, is_output_first=true, system_prompt='', is_first_sp=true, is_last_user=false) %}{% for message in messages %}{% if message['role'] == 'system' %}{% if ns.is_first_sp %}{% set ns.system_prompt = ns.system_prompt + message['content'] %}{% set ns.is_first_sp = false %}{% else %}{% set ns.system_prompt = ns.system_prompt + '\n\n' + message['content'] %}{% endif %}{% endif %}{% if not ns.is_tool_message and (message['role'] == 'tool' or (message['role'] == 'user' and message['content'].startswith('<tool_response>') and message['content'].endswith('</tool_response>'))) %}{% set ns.is_tool_message = true %}{% set ns.first_tool_index = loop.index0 %}{% endif %}{% endfor %}{% if tools is defined and tools is not none %}{% set tool_ns = namespace(text='<|begin_of_tool_description|>Tool calling capabilities.\nYou may call one or more functions to assist with the user query. You have the following functions available:', return_text='For tool call returns, you MUST use the following format:\n<tool_call>{\"name\": \"function-name\", \"arguments\": {\"param1\": \"value1\", \"param2\": \"value2\"}}</tool_call>\n<|end_of_tool_description|>') %}{% for tool in tools %}{% set tool_ns.text = tool_ns.text + '\n```json\n' + (tool | tojson) + '\n```' %}{% endfor %}{% set tool_ns.text = tool_ns.text + '\n' + tool_ns.return_text %}{% if ns.system_prompt == '' %}{% set ns.system_prompt = tool_ns.text %}{% else %}{% set ns.system_prompt = ns.system_prompt + '\n\n' + tool_ns.text %}{% endif %}{% endif %}{{ bos_token }}{{ ns.system_prompt }}{% for message in messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{% set ns.is_tool = false %}{% set ns.is_first = false %}{% set ns.is_last_user = true %}{{ '<|User|>' + content }}{% endif %}{% if message['role'] == 'assistant' %}{% if '</think>' in content and not loop.last and loop.index0 < (ns.first_tool_index - 1) %}{% set content = content.rsplit('</think>', 1)[-1].lstrip('\n') %}{% endif %}{% if '<think>' not in content and '</think>' not in content and loop.last %}{% set content = '<think>\n\n</think>\n\n' + content %}{% endif %}{% endif %}{% if message['role'] == 'assistant' and message['tool_calls'] is defined and message['tool_calls'] is not none %}{% set ns.is_last_user = false %}{{ '<|Assistant|>' }}{% if content is not none %}{{ content }}{% endif %}{% set ns.is_first = false %}{% set ns.is_tool = false %}{% set ns.is_output_first = true %}{% for tool in message['tool_calls'] %}{% if tool['function']['arguments'] is string %}{% set tool_call_str = '{\"name\": \"' + tool['function']['name'] + '\", \"arguments\": ' + tool['function']['arguments'] + '}' %}{% else %}{% set tool_call_str = '{\"name\": \"' + tool['function']['name'] + '\", \"arguments\": ' + tool['function']['arguments']|tojson + '}' %}{% endif %}{% if not ns.is_first %}{{ '<tool_call>' + tool_call_str + '</tool_call>' }}{% set ns.is_first = true %}{% else %}{{ '\n' + '<tool_call>' + tool_call_str + '</tool_call>' }}{% endif %}{% endfor %}{{ '<|end_of_text|>' }}{% endif %}{% if message['role'] == 'assistant' and (message['tool_calls'] is not defined or message['tool_calls'] is none)%}{% set ns.is_last_user = false %}{% set ns.is_tool = false %}{% set ns.is_output_first = true %}{{ '<|Assistant|>' + content + '<|end_of_text|>' }}{% endif %}{% if message['role'] == 'tool' %}{% set ns.is_last_user = false %}{% set ns.is_tool = true %}{% if ns.is_output_first %}{{ '<|User|><tool_response>' + content + '</tool_response>' }}{% set ns.is_output_first = false %}{% else %}{{ '\n<tool_response>' + content + '</tool_response>' }}{% endif %}{% endif %}{% endfor %}{% if add_generation_prompt and (ns.is_last_user or ns.is_tool) %}{{ '<|Assistant|>' }}{% if enable_thinking is defined and enable_thinking is false %}{{ '<think>\n\n</think>\n\n' }}{% elif forced_thinking is defined and forced_thinking is true %}{{ '<think>\n' }}{% endif %}{% endif %}
|
config.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"YoutuForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_youtu.YoutuConfig",
|
| 9 |
+
"AutoModel": "modeling_youtu.YoutuModel",
|
| 10 |
+
"AutoModelForCausalLM": "modeling_youtu.YoutuForCausalLM"
|
| 11 |
+
},
|
| 12 |
+
"bos_token_id": 128000,
|
| 13 |
+
"embedding_initializer_range": null,
|
| 14 |
+
"eos_token_id": 128001,
|
| 15 |
+
"hidden_act": "silu",
|
| 16 |
+
"hidden_size": 2048,
|
| 17 |
+
"initializer_range": null,
|
| 18 |
+
"intermediate_size": 6144,
|
| 19 |
+
"kv_lora_rank": 512,
|
| 20 |
+
"max_position_embeddings": 131072,
|
| 21 |
+
"mlp_bias": false,
|
| 22 |
+
"model_type": "deepseek_v2",
|
| 23 |
+
"num_attention_heads": 16,
|
| 24 |
+
"num_hidden_layers": 32,
|
| 25 |
+
"num_key_value_heads": 16,
|
| 26 |
+
"q_lora_rank": 1536,
|
| 27 |
+
"qk_nope_head_dim": 128,
|
| 28 |
+
"qk_rope_head_dim": 64,
|
| 29 |
+
"quantization": {
|
| 30 |
+
"group_size": 64,
|
| 31 |
+
"bits": 4,
|
| 32 |
+
"mode": "affine"
|
| 33 |
+
},
|
| 34 |
+
"quantization_config": {
|
| 35 |
+
"group_size": 64,
|
| 36 |
+
"bits": 4,
|
| 37 |
+
"mode": "affine"
|
| 38 |
+
},
|
| 39 |
+
"rms_norm_eps": 1e-06,
|
| 40 |
+
"rope_interleave": true,
|
| 41 |
+
"rope_scaling": {
|
| 42 |
+
"type": "yarn",
|
| 43 |
+
"factor": 1.0,
|
| 44 |
+
"mscale_all_dim": 0
|
| 45 |
+
},
|
| 46 |
+
"rope_theta": 1600000,
|
| 47 |
+
"tie_word_embeddings": true,
|
| 48 |
+
"torch_dtype": "bfloat16",
|
| 49 |
+
"transformers_version": "4.56.0",
|
| 50 |
+
"use_cache": true,
|
| 51 |
+
"v_head_dim": 128,
|
| 52 |
+
"vocab_size": 128256
|
| 53 |
+
}
|
configuration_youtu.py
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# coding=utf-8
|
| 2 |
+
# Copyright 2025 Tencent Youtu Lab and the HuggingFace Inc. team. All rights reserved.
|
| 3 |
+
|
| 4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
# you may not use this file except in compliance with the License.
|
| 6 |
+
# You may obtain a copy of the License at
|
| 7 |
+
#
|
| 8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
#
|
| 10 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
# See the License for the specific language governing permissions and
|
| 14 |
+
# limitations under the License.
|
| 15 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 16 |
+
from transformers.modeling_rope_utils import rope_config_validation
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
Youtu_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class YoutuConfig(PretrainedConfig):
|
| 23 |
+
r"""
|
| 24 |
+
This is the configuration class to store the configuration of a [`YoutuModel`]. It is used to instantiate an Youtu
|
| 25 |
+
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
| 26 |
+
defaults will yield a similar configuration to that of the Youtu-LLM-2B.
|
| 27 |
+
e.g. [tencent/Youtu-LLM-2B](https://huggingface.co/tencent/Youtu-LLM-2B)
|
| 28 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
| 29 |
+
documentation from [`PretrainedConfig`] for more information.
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
Args:
|
| 33 |
+
vocab_size (`int`, *optional*, defaults to 128256):
|
| 34 |
+
Vocabulary size of the Deep model. Defines the number of different tokens that can be represented by the
|
| 35 |
+
`inputs_ids` passed when calling [`YoutuModel`]
|
| 36 |
+
hidden_size (`int`, *optional*, defaults to 2048):
|
| 37 |
+
Dimension of the hidden representations.
|
| 38 |
+
intermediate_size (`int`, *optional*, defaults to 6144):
|
| 39 |
+
Dimension of the MLP representations.
|
| 40 |
+
num_hidden_layers (`int`, *optional*, defaults to 32):
|
| 41 |
+
Number of hidden layers in the Transformer decoder.
|
| 42 |
+
num_attention_heads (`int`, *optional*, defaults to 16):
|
| 43 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
| 44 |
+
num_key_value_heads (`int`, *optional*, defaults to 16):
|
| 45 |
+
In MLA, num_key_value_heads=num_attention_heads.
|
| 46 |
+
kv_lora_rank (`int`, *optional*, defaults to 512):
|
| 47 |
+
Rank of the LoRA matrices for key and value projections.
|
| 48 |
+
q_lora_rank (`int`, *optional*, defaults to 1536):
|
| 49 |
+
Rank of the LoRA matrices for query projections.
|
| 50 |
+
qk_rope_head_dim (`int`, *optional*, defaults to 64):
|
| 51 |
+
Dimension of the query/key heads that use rotary position embeddings.
|
| 52 |
+
v_head_dim (`int`, *optional*, defaults to 128):
|
| 53 |
+
Dimension of the value heads.
|
| 54 |
+
qk_nope_head_dim (`int`, *optional*, defaults to 128):
|
| 55 |
+
Dimension of the query/key heads that don't use rotary position embeddings.
|
| 56 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
| 57 |
+
The non-linear activation function (function or string) in the decoder.
|
| 58 |
+
max_position_embeddings (`int`, *optional*, defaults to 131072):
|
| 59 |
+
The maximum sequence length that this model might ever be used with.
|
| 60 |
+
initializer_range (`float`, *optional*, defaults to None):
|
| 61 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices, except embedding matrices.
|
| 62 |
+
embedding_initializer_range (`float`, *optional*, defaults to None):
|
| 63 |
+
The standard deviation of the truncated_normal_initializer for initializing all embedding matrices.
|
| 64 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-06):
|
| 65 |
+
The epsilon used by the rms normalization layers.
|
| 66 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
| 67 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
| 68 |
+
relevant if `config.is_decoder=True`.
|
| 69 |
+
pad_token_id (`int`, *optional*):
|
| 70 |
+
Padding token id.
|
| 71 |
+
bos_token_id (`int`, *optional*, defaults to 128000):
|
| 72 |
+
Beginning of stream token id.
|
| 73 |
+
eos_token_id (`int`, *optional*, defaults to 128001):
|
| 74 |
+
End of stream token id.
|
| 75 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `True`):
|
| 76 |
+
Whether to tie weight embeddings
|
| 77 |
+
rope_theta (`float`, *optional*, defaults to 1600000):
|
| 78 |
+
The base period of the RoPE embeddings.
|
| 79 |
+
rope_scaling (`Dict`, *optional*, defaults to `None`):
|
| 80 |
+
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
|
| 81 |
+
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
|
| 82 |
+
`{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
|
| 83 |
+
`max_position_embeddings` to the expected new maximum.
|
| 84 |
+
rope_interleave (`bool`, *optional*, defaults to `True`):
|
| 85 |
+
Whether to interleave the rotary position embeddings.
|
| 86 |
+
attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
|
| 87 |
+
Whether to use a bias in the query, key, value and output projection layers during self-attention.
|
| 88 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
| 89 |
+
The dropout ratio for the attention probabilities.
|
| 90 |
+
|
| 91 |
+
```python
|
| 92 |
+
>>> from transformers import YoutuModel, YoutuConfig
|
| 93 |
+
|
| 94 |
+
>>> # Initializing a Youtu-LLM-2B style configuration
|
| 95 |
+
>>> configuration = YoutuConfig()
|
| 96 |
+
|
| 97 |
+
>>> # Accessing the model configuration
|
| 98 |
+
>>> configuration = model.config
|
| 99 |
+
```"""
|
| 100 |
+
|
| 101 |
+
model_type = "youtu_llm"
|
| 102 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
| 103 |
+
base_model_tp_plan = {
|
| 104 |
+
"layers.*.mlp.gate_proj": "local_colwise",
|
| 105 |
+
"layers.*.mlp.up_proj": "local_colwise",
|
| 106 |
+
"layers.*.mlp.down_proj": "local_rowwise",
|
| 107 |
+
"layers.*.mlp": "gather", # This is the only moment where results are gathered
|
| 108 |
+
}
|
| 109 |
+
base_model_pp_plan = {
|
| 110 |
+
"embed_tokens": (["input_ids"], ["inputs_embeds"]),
|
| 111 |
+
"layers": (["hidden_states", "attention_mask"], ["hidden_states"]),
|
| 112 |
+
"norm": (["hidden_states"], ["hidden_states"]),
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
def __init__(
|
| 116 |
+
self,
|
| 117 |
+
vocab_size=128256,
|
| 118 |
+
hidden_size=2048,
|
| 119 |
+
intermediate_size=6144,
|
| 120 |
+
num_hidden_layers=32,
|
| 121 |
+
num_attention_heads=16,
|
| 122 |
+
num_key_value_heads=16,
|
| 123 |
+
kv_lora_rank=512,
|
| 124 |
+
q_lora_rank=1536,
|
| 125 |
+
qk_rope_head_dim=64,
|
| 126 |
+
v_head_dim=128,
|
| 127 |
+
qk_nope_head_dim=128,
|
| 128 |
+
hidden_act="silu",
|
| 129 |
+
max_position_embeddings=131072,
|
| 130 |
+
initializer_range=None,
|
| 131 |
+
embedding_initializer_range=None,
|
| 132 |
+
rms_norm_eps=1e-6,
|
| 133 |
+
use_cache=True,
|
| 134 |
+
pad_token_id=None,
|
| 135 |
+
bos_token_id=128000,
|
| 136 |
+
eos_token_id=128001,
|
| 137 |
+
tie_word_embeddings=True,
|
| 138 |
+
rope_theta=1600000,
|
| 139 |
+
rope_scaling=None,
|
| 140 |
+
rope_interleave=True,
|
| 141 |
+
attention_bias=False,
|
| 142 |
+
attention_dropout=0.0,
|
| 143 |
+
**kwargs,
|
| 144 |
+
):
|
| 145 |
+
self.vocab_size = vocab_size
|
| 146 |
+
self.max_position_embeddings = max_position_embeddings
|
| 147 |
+
self.hidden_size = hidden_size
|
| 148 |
+
self.intermediate_size = intermediate_size
|
| 149 |
+
self.num_hidden_layers = num_hidden_layers
|
| 150 |
+
self.num_attention_heads = num_attention_heads
|
| 151 |
+
self.kv_lora_rank = kv_lora_rank
|
| 152 |
+
self.q_lora_rank = q_lora_rank
|
| 153 |
+
self.qk_rope_head_dim = qk_rope_head_dim
|
| 154 |
+
self.v_head_dim = v_head_dim
|
| 155 |
+
self.qk_nope_head_dim = qk_nope_head_dim
|
| 156 |
+
self.qk_head_dim = qk_nope_head_dim + qk_rope_head_dim
|
| 157 |
+
self.head_dim = qk_rope_head_dim
|
| 158 |
+
self.rope_interleave = rope_interleave
|
| 159 |
+
|
| 160 |
+
# for backward compatibility
|
| 161 |
+
if num_key_value_heads is None:
|
| 162 |
+
num_key_value_heads = num_attention_heads
|
| 163 |
+
|
| 164 |
+
self.mlp_bias = False
|
| 165 |
+
self.num_key_value_heads = num_key_value_heads
|
| 166 |
+
self.hidden_act = hidden_act
|
| 167 |
+
# if initializer_range is None, set it to 2.0 / (5.0 * self.hidden_size) ** 0.5
|
| 168 |
+
self.initializer_range = (2.0 / (5.0 * self.hidden_size)) ** 0.5 if initializer_range is None else initializer_range
|
| 169 |
+
# if embedding_initializer_range is None, set it to 2.0 * self.initializer_range
|
| 170 |
+
self.embedding_initializer_range = self.initializer_range * 2.0 if embedding_initializer_range is None else embedding_initializer_range
|
| 171 |
+
self.rms_norm_eps = rms_norm_eps
|
| 172 |
+
self.use_cache = use_cache
|
| 173 |
+
self.rope_theta = rope_theta
|
| 174 |
+
self.rope_scaling = rope_scaling
|
| 175 |
+
self.attention_bias = attention_bias
|
| 176 |
+
self.attention_dropout = attention_dropout
|
| 177 |
+
# Validate the correctness of rotary position embeddings parameters
|
| 178 |
+
# BC: if there is a 'type' field, copy it it to 'rope_type'.
|
| 179 |
+
if self.rope_scaling is not None and "type" in self.rope_scaling:
|
| 180 |
+
self.rope_scaling["rope_type"] = self.rope_scaling["type"]
|
| 181 |
+
|
| 182 |
+
if self.rope_scaling is not None:
|
| 183 |
+
for key in ["beta_fast", "beta_slow", "factor"]:
|
| 184 |
+
if key in self.rope_scaling:
|
| 185 |
+
self.rope_scaling[key] = float(self.rope_scaling[key])
|
| 186 |
+
|
| 187 |
+
rope_config_validation(self)
|
| 188 |
+
|
| 189 |
+
super().__init__(
|
| 190 |
+
pad_token_id=pad_token_id,
|
| 191 |
+
bos_token_id=bos_token_id,
|
| 192 |
+
eos_token_id=eos_token_id,
|
| 193 |
+
tie_word_embeddings=tie_word_embeddings,
|
| 194 |
+
**kwargs,
|
| 195 |
+
)
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
__all__ = ["YoutuConfig"]
|
generation_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 128000,
|
| 4 |
+
"eos_token_id": 128001,
|
| 5 |
+
"do_sample": true,
|
| 6 |
+
"temperature": 1.0,
|
| 7 |
+
"top_k": 20,
|
| 8 |
+
"top_p": 0.95,
|
| 9 |
+
"transformers_version": "4.56.0",
|
| 10 |
+
"use_cache": false
|
| 11 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cf243e7e3a01ad5934078fa0e8195ed27b17d3f90b8d54c0cbb8fa0ee1a013a6
|
| 3 |
+
size 1251517638
|
model.safetensors.index.json
ADDED
|
@@ -0,0 +1,911 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
| 5 |
+
},
|
| 6 |
+
"weight_map": {
|
| 7 |
+
"lm_head.biases": "model.safetensors",
|
| 8 |
+
"lm_head.scales": "model.safetensors",
|
| 9 |
+
"lm_head.weight": "model.safetensors",
|
| 10 |
+
"model.embed_tokens.biases": "model.safetensors",
|
| 11 |
+
"model.embed_tokens.scales": "model.safetensors",
|
| 12 |
+
"model.embed_tokens.weight": "model.safetensors",
|
| 13 |
+
"model.layers.0.input_layernorm.weight": "model.safetensors",
|
| 14 |
+
"model.layers.0.mlp.down_proj.biases": "model.safetensors",
|
| 15 |
+
"model.layers.0.mlp.down_proj.scales": "model.safetensors",
|
| 16 |
+
"model.layers.0.mlp.down_proj.weight": "model.safetensors",
|
| 17 |
+
"model.layers.0.mlp.gate_proj.biases": "model.safetensors",
|
| 18 |
+
"model.layers.0.mlp.gate_proj.scales": "model.safetensors",
|
| 19 |
+
"model.layers.0.mlp.gate_proj.weight": "model.safetensors",
|
| 20 |
+
"model.layers.0.mlp.up_proj.biases": "model.safetensors",
|
| 21 |
+
"model.layers.0.mlp.up_proj.scales": "model.safetensors",
|
| 22 |
+
"model.layers.0.mlp.up_proj.weight": "model.safetensors",
|
| 23 |
+
"model.layers.0.post_attention_layernorm.weight": "model.safetensors",
|
| 24 |
+
"model.layers.0.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 25 |
+
"model.layers.0.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 26 |
+
"model.layers.0.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 27 |
+
"model.layers.0.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 28 |
+
"model.layers.0.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 29 |
+
"model.layers.0.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 30 |
+
"model.layers.0.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 31 |
+
"model.layers.0.self_attn.o_proj.biases": "model.safetensors",
|
| 32 |
+
"model.layers.0.self_attn.o_proj.scales": "model.safetensors",
|
| 33 |
+
"model.layers.0.self_attn.o_proj.weight": "model.safetensors",
|
| 34 |
+
"model.layers.0.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 35 |
+
"model.layers.0.self_attn.q_a_proj.biases": "model.safetensors",
|
| 36 |
+
"model.layers.0.self_attn.q_a_proj.scales": "model.safetensors",
|
| 37 |
+
"model.layers.0.self_attn.q_a_proj.weight": "model.safetensors",
|
| 38 |
+
"model.layers.0.self_attn.q_b_proj.biases": "model.safetensors",
|
| 39 |
+
"model.layers.0.self_attn.q_b_proj.scales": "model.safetensors",
|
| 40 |
+
"model.layers.0.self_attn.q_b_proj.weight": "model.safetensors",
|
| 41 |
+
"model.layers.1.input_layernorm.weight": "model.safetensors",
|
| 42 |
+
"model.layers.1.mlp.down_proj.biases": "model.safetensors",
|
| 43 |
+
"model.layers.1.mlp.down_proj.scales": "model.safetensors",
|
| 44 |
+
"model.layers.1.mlp.down_proj.weight": "model.safetensors",
|
| 45 |
+
"model.layers.1.mlp.gate_proj.biases": "model.safetensors",
|
| 46 |
+
"model.layers.1.mlp.gate_proj.scales": "model.safetensors",
|
| 47 |
+
"model.layers.1.mlp.gate_proj.weight": "model.safetensors",
|
| 48 |
+
"model.layers.1.mlp.up_proj.biases": "model.safetensors",
|
| 49 |
+
"model.layers.1.mlp.up_proj.scales": "model.safetensors",
|
| 50 |
+
"model.layers.1.mlp.up_proj.weight": "model.safetensors",
|
| 51 |
+
"model.layers.1.post_attention_layernorm.weight": "model.safetensors",
|
| 52 |
+
"model.layers.1.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 53 |
+
"model.layers.1.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 54 |
+
"model.layers.1.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 55 |
+
"model.layers.1.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 56 |
+
"model.layers.1.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 57 |
+
"model.layers.1.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 58 |
+
"model.layers.1.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 59 |
+
"model.layers.1.self_attn.o_proj.biases": "model.safetensors",
|
| 60 |
+
"model.layers.1.self_attn.o_proj.scales": "model.safetensors",
|
| 61 |
+
"model.layers.1.self_attn.o_proj.weight": "model.safetensors",
|
| 62 |
+
"model.layers.1.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 63 |
+
"model.layers.1.self_attn.q_a_proj.biases": "model.safetensors",
|
| 64 |
+
"model.layers.1.self_attn.q_a_proj.scales": "model.safetensors",
|
| 65 |
+
"model.layers.1.self_attn.q_a_proj.weight": "model.safetensors",
|
| 66 |
+
"model.layers.1.self_attn.q_b_proj.biases": "model.safetensors",
|
| 67 |
+
"model.layers.1.self_attn.q_b_proj.scales": "model.safetensors",
|
| 68 |
+
"model.layers.1.self_attn.q_b_proj.weight": "model.safetensors",
|
| 69 |
+
"model.layers.10.input_layernorm.weight": "model.safetensors",
|
| 70 |
+
"model.layers.10.mlp.down_proj.biases": "model.safetensors",
|
| 71 |
+
"model.layers.10.mlp.down_proj.scales": "model.safetensors",
|
| 72 |
+
"model.layers.10.mlp.down_proj.weight": "model.safetensors",
|
| 73 |
+
"model.layers.10.mlp.gate_proj.biases": "model.safetensors",
|
| 74 |
+
"model.layers.10.mlp.gate_proj.scales": "model.safetensors",
|
| 75 |
+
"model.layers.10.mlp.gate_proj.weight": "model.safetensors",
|
| 76 |
+
"model.layers.10.mlp.up_proj.biases": "model.safetensors",
|
| 77 |
+
"model.layers.10.mlp.up_proj.scales": "model.safetensors",
|
| 78 |
+
"model.layers.10.mlp.up_proj.weight": "model.safetensors",
|
| 79 |
+
"model.layers.10.post_attention_layernorm.weight": "model.safetensors",
|
| 80 |
+
"model.layers.10.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 81 |
+
"model.layers.10.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 82 |
+
"model.layers.10.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 83 |
+
"model.layers.10.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 84 |
+
"model.layers.10.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 85 |
+
"model.layers.10.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 86 |
+
"model.layers.10.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 87 |
+
"model.layers.10.self_attn.o_proj.biases": "model.safetensors",
|
| 88 |
+
"model.layers.10.self_attn.o_proj.scales": "model.safetensors",
|
| 89 |
+
"model.layers.10.self_attn.o_proj.weight": "model.safetensors",
|
| 90 |
+
"model.layers.10.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 91 |
+
"model.layers.10.self_attn.q_a_proj.biases": "model.safetensors",
|
| 92 |
+
"model.layers.10.self_attn.q_a_proj.scales": "model.safetensors",
|
| 93 |
+
"model.layers.10.self_attn.q_a_proj.weight": "model.safetensors",
|
| 94 |
+
"model.layers.10.self_attn.q_b_proj.biases": "model.safetensors",
|
| 95 |
+
"model.layers.10.self_attn.q_b_proj.scales": "model.safetensors",
|
| 96 |
+
"model.layers.10.self_attn.q_b_proj.weight": "model.safetensors",
|
| 97 |
+
"model.layers.11.input_layernorm.weight": "model.safetensors",
|
| 98 |
+
"model.layers.11.mlp.down_proj.biases": "model.safetensors",
|
| 99 |
+
"model.layers.11.mlp.down_proj.scales": "model.safetensors",
|
| 100 |
+
"model.layers.11.mlp.down_proj.weight": "model.safetensors",
|
| 101 |
+
"model.layers.11.mlp.gate_proj.biases": "model.safetensors",
|
| 102 |
+
"model.layers.11.mlp.gate_proj.scales": "model.safetensors",
|
| 103 |
+
"model.layers.11.mlp.gate_proj.weight": "model.safetensors",
|
| 104 |
+
"model.layers.11.mlp.up_proj.biases": "model.safetensors",
|
| 105 |
+
"model.layers.11.mlp.up_proj.scales": "model.safetensors",
|
| 106 |
+
"model.layers.11.mlp.up_proj.weight": "model.safetensors",
|
| 107 |
+
"model.layers.11.post_attention_layernorm.weight": "model.safetensors",
|
| 108 |
+
"model.layers.11.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 109 |
+
"model.layers.11.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 110 |
+
"model.layers.11.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 111 |
+
"model.layers.11.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 112 |
+
"model.layers.11.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 113 |
+
"model.layers.11.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 114 |
+
"model.layers.11.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 115 |
+
"model.layers.11.self_attn.o_proj.biases": "model.safetensors",
|
| 116 |
+
"model.layers.11.self_attn.o_proj.scales": "model.safetensors",
|
| 117 |
+
"model.layers.11.self_attn.o_proj.weight": "model.safetensors",
|
| 118 |
+
"model.layers.11.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 119 |
+
"model.layers.11.self_attn.q_a_proj.biases": "model.safetensors",
|
| 120 |
+
"model.layers.11.self_attn.q_a_proj.scales": "model.safetensors",
|
| 121 |
+
"model.layers.11.self_attn.q_a_proj.weight": "model.safetensors",
|
| 122 |
+
"model.layers.11.self_attn.q_b_proj.biases": "model.safetensors",
|
| 123 |
+
"model.layers.11.self_attn.q_b_proj.scales": "model.safetensors",
|
| 124 |
+
"model.layers.11.self_attn.q_b_proj.weight": "model.safetensors",
|
| 125 |
+
"model.layers.12.input_layernorm.weight": "model.safetensors",
|
| 126 |
+
"model.layers.12.mlp.down_proj.biases": "model.safetensors",
|
| 127 |
+
"model.layers.12.mlp.down_proj.scales": "model.safetensors",
|
| 128 |
+
"model.layers.12.mlp.down_proj.weight": "model.safetensors",
|
| 129 |
+
"model.layers.12.mlp.gate_proj.biases": "model.safetensors",
|
| 130 |
+
"model.layers.12.mlp.gate_proj.scales": "model.safetensors",
|
| 131 |
+
"model.layers.12.mlp.gate_proj.weight": "model.safetensors",
|
| 132 |
+
"model.layers.12.mlp.up_proj.biases": "model.safetensors",
|
| 133 |
+
"model.layers.12.mlp.up_proj.scales": "model.safetensors",
|
| 134 |
+
"model.layers.12.mlp.up_proj.weight": "model.safetensors",
|
| 135 |
+
"model.layers.12.post_attention_layernorm.weight": "model.safetensors",
|
| 136 |
+
"model.layers.12.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 137 |
+
"model.layers.12.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 138 |
+
"model.layers.12.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 139 |
+
"model.layers.12.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 140 |
+
"model.layers.12.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 141 |
+
"model.layers.12.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 142 |
+
"model.layers.12.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 143 |
+
"model.layers.12.self_attn.o_proj.biases": "model.safetensors",
|
| 144 |
+
"model.layers.12.self_attn.o_proj.scales": "model.safetensors",
|
| 145 |
+
"model.layers.12.self_attn.o_proj.weight": "model.safetensors",
|
| 146 |
+
"model.layers.12.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 147 |
+
"model.layers.12.self_attn.q_a_proj.biases": "model.safetensors",
|
| 148 |
+
"model.layers.12.self_attn.q_a_proj.scales": "model.safetensors",
|
| 149 |
+
"model.layers.12.self_attn.q_a_proj.weight": "model.safetensors",
|
| 150 |
+
"model.layers.12.self_attn.q_b_proj.biases": "model.safetensors",
|
| 151 |
+
"model.layers.12.self_attn.q_b_proj.scales": "model.safetensors",
|
| 152 |
+
"model.layers.12.self_attn.q_b_proj.weight": "model.safetensors",
|
| 153 |
+
"model.layers.13.input_layernorm.weight": "model.safetensors",
|
| 154 |
+
"model.layers.13.mlp.down_proj.biases": "model.safetensors",
|
| 155 |
+
"model.layers.13.mlp.down_proj.scales": "model.safetensors",
|
| 156 |
+
"model.layers.13.mlp.down_proj.weight": "model.safetensors",
|
| 157 |
+
"model.layers.13.mlp.gate_proj.biases": "model.safetensors",
|
| 158 |
+
"model.layers.13.mlp.gate_proj.scales": "model.safetensors",
|
| 159 |
+
"model.layers.13.mlp.gate_proj.weight": "model.safetensors",
|
| 160 |
+
"model.layers.13.mlp.up_proj.biases": "model.safetensors",
|
| 161 |
+
"model.layers.13.mlp.up_proj.scales": "model.safetensors",
|
| 162 |
+
"model.layers.13.mlp.up_proj.weight": "model.safetensors",
|
| 163 |
+
"model.layers.13.post_attention_layernorm.weight": "model.safetensors",
|
| 164 |
+
"model.layers.13.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 165 |
+
"model.layers.13.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 166 |
+
"model.layers.13.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 167 |
+
"model.layers.13.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 168 |
+
"model.layers.13.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 169 |
+
"model.layers.13.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 170 |
+
"model.layers.13.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 171 |
+
"model.layers.13.self_attn.o_proj.biases": "model.safetensors",
|
| 172 |
+
"model.layers.13.self_attn.o_proj.scales": "model.safetensors",
|
| 173 |
+
"model.layers.13.self_attn.o_proj.weight": "model.safetensors",
|
| 174 |
+
"model.layers.13.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 175 |
+
"model.layers.13.self_attn.q_a_proj.biases": "model.safetensors",
|
| 176 |
+
"model.layers.13.self_attn.q_a_proj.scales": "model.safetensors",
|
| 177 |
+
"model.layers.13.self_attn.q_a_proj.weight": "model.safetensors",
|
| 178 |
+
"model.layers.13.self_attn.q_b_proj.biases": "model.safetensors",
|
| 179 |
+
"model.layers.13.self_attn.q_b_proj.scales": "model.safetensors",
|
| 180 |
+
"model.layers.13.self_attn.q_b_proj.weight": "model.safetensors",
|
| 181 |
+
"model.layers.14.input_layernorm.weight": "model.safetensors",
|
| 182 |
+
"model.layers.14.mlp.down_proj.biases": "model.safetensors",
|
| 183 |
+
"model.layers.14.mlp.down_proj.scales": "model.safetensors",
|
| 184 |
+
"model.layers.14.mlp.down_proj.weight": "model.safetensors",
|
| 185 |
+
"model.layers.14.mlp.gate_proj.biases": "model.safetensors",
|
| 186 |
+
"model.layers.14.mlp.gate_proj.scales": "model.safetensors",
|
| 187 |
+
"model.layers.14.mlp.gate_proj.weight": "model.safetensors",
|
| 188 |
+
"model.layers.14.mlp.up_proj.biases": "model.safetensors",
|
| 189 |
+
"model.layers.14.mlp.up_proj.scales": "model.safetensors",
|
| 190 |
+
"model.layers.14.mlp.up_proj.weight": "model.safetensors",
|
| 191 |
+
"model.layers.14.post_attention_layernorm.weight": "model.safetensors",
|
| 192 |
+
"model.layers.14.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 193 |
+
"model.layers.14.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 194 |
+
"model.layers.14.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 195 |
+
"model.layers.14.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 196 |
+
"model.layers.14.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 197 |
+
"model.layers.14.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 198 |
+
"model.layers.14.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 199 |
+
"model.layers.14.self_attn.o_proj.biases": "model.safetensors",
|
| 200 |
+
"model.layers.14.self_attn.o_proj.scales": "model.safetensors",
|
| 201 |
+
"model.layers.14.self_attn.o_proj.weight": "model.safetensors",
|
| 202 |
+
"model.layers.14.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 203 |
+
"model.layers.14.self_attn.q_a_proj.biases": "model.safetensors",
|
| 204 |
+
"model.layers.14.self_attn.q_a_proj.scales": "model.safetensors",
|
| 205 |
+
"model.layers.14.self_attn.q_a_proj.weight": "model.safetensors",
|
| 206 |
+
"model.layers.14.self_attn.q_b_proj.biases": "model.safetensors",
|
| 207 |
+
"model.layers.14.self_attn.q_b_proj.scales": "model.safetensors",
|
| 208 |
+
"model.layers.14.self_attn.q_b_proj.weight": "model.safetensors",
|
| 209 |
+
"model.layers.15.input_layernorm.weight": "model.safetensors",
|
| 210 |
+
"model.layers.15.mlp.down_proj.biases": "model.safetensors",
|
| 211 |
+
"model.layers.15.mlp.down_proj.scales": "model.safetensors",
|
| 212 |
+
"model.layers.15.mlp.down_proj.weight": "model.safetensors",
|
| 213 |
+
"model.layers.15.mlp.gate_proj.biases": "model.safetensors",
|
| 214 |
+
"model.layers.15.mlp.gate_proj.scales": "model.safetensors",
|
| 215 |
+
"model.layers.15.mlp.gate_proj.weight": "model.safetensors",
|
| 216 |
+
"model.layers.15.mlp.up_proj.biases": "model.safetensors",
|
| 217 |
+
"model.layers.15.mlp.up_proj.scales": "model.safetensors",
|
| 218 |
+
"model.layers.15.mlp.up_proj.weight": "model.safetensors",
|
| 219 |
+
"model.layers.15.post_attention_layernorm.weight": "model.safetensors",
|
| 220 |
+
"model.layers.15.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 221 |
+
"model.layers.15.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 222 |
+
"model.layers.15.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 223 |
+
"model.layers.15.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 224 |
+
"model.layers.15.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 225 |
+
"model.layers.15.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 226 |
+
"model.layers.15.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 227 |
+
"model.layers.15.self_attn.o_proj.biases": "model.safetensors",
|
| 228 |
+
"model.layers.15.self_attn.o_proj.scales": "model.safetensors",
|
| 229 |
+
"model.layers.15.self_attn.o_proj.weight": "model.safetensors",
|
| 230 |
+
"model.layers.15.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 231 |
+
"model.layers.15.self_attn.q_a_proj.biases": "model.safetensors",
|
| 232 |
+
"model.layers.15.self_attn.q_a_proj.scales": "model.safetensors",
|
| 233 |
+
"model.layers.15.self_attn.q_a_proj.weight": "model.safetensors",
|
| 234 |
+
"model.layers.15.self_attn.q_b_proj.biases": "model.safetensors",
|
| 235 |
+
"model.layers.15.self_attn.q_b_proj.scales": "model.safetensors",
|
| 236 |
+
"model.layers.15.self_attn.q_b_proj.weight": "model.safetensors",
|
| 237 |
+
"model.layers.16.input_layernorm.weight": "model.safetensors",
|
| 238 |
+
"model.layers.16.mlp.down_proj.biases": "model.safetensors",
|
| 239 |
+
"model.layers.16.mlp.down_proj.scales": "model.safetensors",
|
| 240 |
+
"model.layers.16.mlp.down_proj.weight": "model.safetensors",
|
| 241 |
+
"model.layers.16.mlp.gate_proj.biases": "model.safetensors",
|
| 242 |
+
"model.layers.16.mlp.gate_proj.scales": "model.safetensors",
|
| 243 |
+
"model.layers.16.mlp.gate_proj.weight": "model.safetensors",
|
| 244 |
+
"model.layers.16.mlp.up_proj.biases": "model.safetensors",
|
| 245 |
+
"model.layers.16.mlp.up_proj.scales": "model.safetensors",
|
| 246 |
+
"model.layers.16.mlp.up_proj.weight": "model.safetensors",
|
| 247 |
+
"model.layers.16.post_attention_layernorm.weight": "model.safetensors",
|
| 248 |
+
"model.layers.16.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 249 |
+
"model.layers.16.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 250 |
+
"model.layers.16.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 251 |
+
"model.layers.16.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 252 |
+
"model.layers.16.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 253 |
+
"model.layers.16.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 254 |
+
"model.layers.16.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 255 |
+
"model.layers.16.self_attn.o_proj.biases": "model.safetensors",
|
| 256 |
+
"model.layers.16.self_attn.o_proj.scales": "model.safetensors",
|
| 257 |
+
"model.layers.16.self_attn.o_proj.weight": "model.safetensors",
|
| 258 |
+
"model.layers.16.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 259 |
+
"model.layers.16.self_attn.q_a_proj.biases": "model.safetensors",
|
| 260 |
+
"model.layers.16.self_attn.q_a_proj.scales": "model.safetensors",
|
| 261 |
+
"model.layers.16.self_attn.q_a_proj.weight": "model.safetensors",
|
| 262 |
+
"model.layers.16.self_attn.q_b_proj.biases": "model.safetensors",
|
| 263 |
+
"model.layers.16.self_attn.q_b_proj.scales": "model.safetensors",
|
| 264 |
+
"model.layers.16.self_attn.q_b_proj.weight": "model.safetensors",
|
| 265 |
+
"model.layers.17.input_layernorm.weight": "model.safetensors",
|
| 266 |
+
"model.layers.17.mlp.down_proj.biases": "model.safetensors",
|
| 267 |
+
"model.layers.17.mlp.down_proj.scales": "model.safetensors",
|
| 268 |
+
"model.layers.17.mlp.down_proj.weight": "model.safetensors",
|
| 269 |
+
"model.layers.17.mlp.gate_proj.biases": "model.safetensors",
|
| 270 |
+
"model.layers.17.mlp.gate_proj.scales": "model.safetensors",
|
| 271 |
+
"model.layers.17.mlp.gate_proj.weight": "model.safetensors",
|
| 272 |
+
"model.layers.17.mlp.up_proj.biases": "model.safetensors",
|
| 273 |
+
"model.layers.17.mlp.up_proj.scales": "model.safetensors",
|
| 274 |
+
"model.layers.17.mlp.up_proj.weight": "model.safetensors",
|
| 275 |
+
"model.layers.17.post_attention_layernorm.weight": "model.safetensors",
|
| 276 |
+
"model.layers.17.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 277 |
+
"model.layers.17.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 278 |
+
"model.layers.17.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 279 |
+
"model.layers.17.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 280 |
+
"model.layers.17.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 281 |
+
"model.layers.17.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 282 |
+
"model.layers.17.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 283 |
+
"model.layers.17.self_attn.o_proj.biases": "model.safetensors",
|
| 284 |
+
"model.layers.17.self_attn.o_proj.scales": "model.safetensors",
|
| 285 |
+
"model.layers.17.self_attn.o_proj.weight": "model.safetensors",
|
| 286 |
+
"model.layers.17.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 287 |
+
"model.layers.17.self_attn.q_a_proj.biases": "model.safetensors",
|
| 288 |
+
"model.layers.17.self_attn.q_a_proj.scales": "model.safetensors",
|
| 289 |
+
"model.layers.17.self_attn.q_a_proj.weight": "model.safetensors",
|
| 290 |
+
"model.layers.17.self_attn.q_b_proj.biases": "model.safetensors",
|
| 291 |
+
"model.layers.17.self_attn.q_b_proj.scales": "model.safetensors",
|
| 292 |
+
"model.layers.17.self_attn.q_b_proj.weight": "model.safetensors",
|
| 293 |
+
"model.layers.18.input_layernorm.weight": "model.safetensors",
|
| 294 |
+
"model.layers.18.mlp.down_proj.biases": "model.safetensors",
|
| 295 |
+
"model.layers.18.mlp.down_proj.scales": "model.safetensors",
|
| 296 |
+
"model.layers.18.mlp.down_proj.weight": "model.safetensors",
|
| 297 |
+
"model.layers.18.mlp.gate_proj.biases": "model.safetensors",
|
| 298 |
+
"model.layers.18.mlp.gate_proj.scales": "model.safetensors",
|
| 299 |
+
"model.layers.18.mlp.gate_proj.weight": "model.safetensors",
|
| 300 |
+
"model.layers.18.mlp.up_proj.biases": "model.safetensors",
|
| 301 |
+
"model.layers.18.mlp.up_proj.scales": "model.safetensors",
|
| 302 |
+
"model.layers.18.mlp.up_proj.weight": "model.safetensors",
|
| 303 |
+
"model.layers.18.post_attention_layernorm.weight": "model.safetensors",
|
| 304 |
+
"model.layers.18.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 305 |
+
"model.layers.18.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 306 |
+
"model.layers.18.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 307 |
+
"model.layers.18.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 308 |
+
"model.layers.18.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 309 |
+
"model.layers.18.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 310 |
+
"model.layers.18.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 311 |
+
"model.layers.18.self_attn.o_proj.biases": "model.safetensors",
|
| 312 |
+
"model.layers.18.self_attn.o_proj.scales": "model.safetensors",
|
| 313 |
+
"model.layers.18.self_attn.o_proj.weight": "model.safetensors",
|
| 314 |
+
"model.layers.18.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 315 |
+
"model.layers.18.self_attn.q_a_proj.biases": "model.safetensors",
|
| 316 |
+
"model.layers.18.self_attn.q_a_proj.scales": "model.safetensors",
|
| 317 |
+
"model.layers.18.self_attn.q_a_proj.weight": "model.safetensors",
|
| 318 |
+
"model.layers.18.self_attn.q_b_proj.biases": "model.safetensors",
|
| 319 |
+
"model.layers.18.self_attn.q_b_proj.scales": "model.safetensors",
|
| 320 |
+
"model.layers.18.self_attn.q_b_proj.weight": "model.safetensors",
|
| 321 |
+
"model.layers.19.input_layernorm.weight": "model.safetensors",
|
| 322 |
+
"model.layers.19.mlp.down_proj.biases": "model.safetensors",
|
| 323 |
+
"model.layers.19.mlp.down_proj.scales": "model.safetensors",
|
| 324 |
+
"model.layers.19.mlp.down_proj.weight": "model.safetensors",
|
| 325 |
+
"model.layers.19.mlp.gate_proj.biases": "model.safetensors",
|
| 326 |
+
"model.layers.19.mlp.gate_proj.scales": "model.safetensors",
|
| 327 |
+
"model.layers.19.mlp.gate_proj.weight": "model.safetensors",
|
| 328 |
+
"model.layers.19.mlp.up_proj.biases": "model.safetensors",
|
| 329 |
+
"model.layers.19.mlp.up_proj.scales": "model.safetensors",
|
| 330 |
+
"model.layers.19.mlp.up_proj.weight": "model.safetensors",
|
| 331 |
+
"model.layers.19.post_attention_layernorm.weight": "model.safetensors",
|
| 332 |
+
"model.layers.19.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 333 |
+
"model.layers.19.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 334 |
+
"model.layers.19.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 335 |
+
"model.layers.19.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 336 |
+
"model.layers.19.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 337 |
+
"model.layers.19.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 338 |
+
"model.layers.19.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 339 |
+
"model.layers.19.self_attn.o_proj.biases": "model.safetensors",
|
| 340 |
+
"model.layers.19.self_attn.o_proj.scales": "model.safetensors",
|
| 341 |
+
"model.layers.19.self_attn.o_proj.weight": "model.safetensors",
|
| 342 |
+
"model.layers.19.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 343 |
+
"model.layers.19.self_attn.q_a_proj.biases": "model.safetensors",
|
| 344 |
+
"model.layers.19.self_attn.q_a_proj.scales": "model.safetensors",
|
| 345 |
+
"model.layers.19.self_attn.q_a_proj.weight": "model.safetensors",
|
| 346 |
+
"model.layers.19.self_attn.q_b_proj.biases": "model.safetensors",
|
| 347 |
+
"model.layers.19.self_attn.q_b_proj.scales": "model.safetensors",
|
| 348 |
+
"model.layers.19.self_attn.q_b_proj.weight": "model.safetensors",
|
| 349 |
+
"model.layers.2.input_layernorm.weight": "model.safetensors",
|
| 350 |
+
"model.layers.2.mlp.down_proj.biases": "model.safetensors",
|
| 351 |
+
"model.layers.2.mlp.down_proj.scales": "model.safetensors",
|
| 352 |
+
"model.layers.2.mlp.down_proj.weight": "model.safetensors",
|
| 353 |
+
"model.layers.2.mlp.gate_proj.biases": "model.safetensors",
|
| 354 |
+
"model.layers.2.mlp.gate_proj.scales": "model.safetensors",
|
| 355 |
+
"model.layers.2.mlp.gate_proj.weight": "model.safetensors",
|
| 356 |
+
"model.layers.2.mlp.up_proj.biases": "model.safetensors",
|
| 357 |
+
"model.layers.2.mlp.up_proj.scales": "model.safetensors",
|
| 358 |
+
"model.layers.2.mlp.up_proj.weight": "model.safetensors",
|
| 359 |
+
"model.layers.2.post_attention_layernorm.weight": "model.safetensors",
|
| 360 |
+
"model.layers.2.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 361 |
+
"model.layers.2.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 362 |
+
"model.layers.2.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 363 |
+
"model.layers.2.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 364 |
+
"model.layers.2.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 365 |
+
"model.layers.2.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 366 |
+
"model.layers.2.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 367 |
+
"model.layers.2.self_attn.o_proj.biases": "model.safetensors",
|
| 368 |
+
"model.layers.2.self_attn.o_proj.scales": "model.safetensors",
|
| 369 |
+
"model.layers.2.self_attn.o_proj.weight": "model.safetensors",
|
| 370 |
+
"model.layers.2.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 371 |
+
"model.layers.2.self_attn.q_a_proj.biases": "model.safetensors",
|
| 372 |
+
"model.layers.2.self_attn.q_a_proj.scales": "model.safetensors",
|
| 373 |
+
"model.layers.2.self_attn.q_a_proj.weight": "model.safetensors",
|
| 374 |
+
"model.layers.2.self_attn.q_b_proj.biases": "model.safetensors",
|
| 375 |
+
"model.layers.2.self_attn.q_b_proj.scales": "model.safetensors",
|
| 376 |
+
"model.layers.2.self_attn.q_b_proj.weight": "model.safetensors",
|
| 377 |
+
"model.layers.20.input_layernorm.weight": "model.safetensors",
|
| 378 |
+
"model.layers.20.mlp.down_proj.biases": "model.safetensors",
|
| 379 |
+
"model.layers.20.mlp.down_proj.scales": "model.safetensors",
|
| 380 |
+
"model.layers.20.mlp.down_proj.weight": "model.safetensors",
|
| 381 |
+
"model.layers.20.mlp.gate_proj.biases": "model.safetensors",
|
| 382 |
+
"model.layers.20.mlp.gate_proj.scales": "model.safetensors",
|
| 383 |
+
"model.layers.20.mlp.gate_proj.weight": "model.safetensors",
|
| 384 |
+
"model.layers.20.mlp.up_proj.biases": "model.safetensors",
|
| 385 |
+
"model.layers.20.mlp.up_proj.scales": "model.safetensors",
|
| 386 |
+
"model.layers.20.mlp.up_proj.weight": "model.safetensors",
|
| 387 |
+
"model.layers.20.post_attention_layernorm.weight": "model.safetensors",
|
| 388 |
+
"model.layers.20.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 389 |
+
"model.layers.20.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 390 |
+
"model.layers.20.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 391 |
+
"model.layers.20.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 392 |
+
"model.layers.20.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 393 |
+
"model.layers.20.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 394 |
+
"model.layers.20.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 395 |
+
"model.layers.20.self_attn.o_proj.biases": "model.safetensors",
|
| 396 |
+
"model.layers.20.self_attn.o_proj.scales": "model.safetensors",
|
| 397 |
+
"model.layers.20.self_attn.o_proj.weight": "model.safetensors",
|
| 398 |
+
"model.layers.20.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 399 |
+
"model.layers.20.self_attn.q_a_proj.biases": "model.safetensors",
|
| 400 |
+
"model.layers.20.self_attn.q_a_proj.scales": "model.safetensors",
|
| 401 |
+
"model.layers.20.self_attn.q_a_proj.weight": "model.safetensors",
|
| 402 |
+
"model.layers.20.self_attn.q_b_proj.biases": "model.safetensors",
|
| 403 |
+
"model.layers.20.self_attn.q_b_proj.scales": "model.safetensors",
|
| 404 |
+
"model.layers.20.self_attn.q_b_proj.weight": "model.safetensors",
|
| 405 |
+
"model.layers.21.input_layernorm.weight": "model.safetensors",
|
| 406 |
+
"model.layers.21.mlp.down_proj.biases": "model.safetensors",
|
| 407 |
+
"model.layers.21.mlp.down_proj.scales": "model.safetensors",
|
| 408 |
+
"model.layers.21.mlp.down_proj.weight": "model.safetensors",
|
| 409 |
+
"model.layers.21.mlp.gate_proj.biases": "model.safetensors",
|
| 410 |
+
"model.layers.21.mlp.gate_proj.scales": "model.safetensors",
|
| 411 |
+
"model.layers.21.mlp.gate_proj.weight": "model.safetensors",
|
| 412 |
+
"model.layers.21.mlp.up_proj.biases": "model.safetensors",
|
| 413 |
+
"model.layers.21.mlp.up_proj.scales": "model.safetensors",
|
| 414 |
+
"model.layers.21.mlp.up_proj.weight": "model.safetensors",
|
| 415 |
+
"model.layers.21.post_attention_layernorm.weight": "model.safetensors",
|
| 416 |
+
"model.layers.21.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 417 |
+
"model.layers.21.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 418 |
+
"model.layers.21.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 419 |
+
"model.layers.21.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 420 |
+
"model.layers.21.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 421 |
+
"model.layers.21.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 422 |
+
"model.layers.21.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 423 |
+
"model.layers.21.self_attn.o_proj.biases": "model.safetensors",
|
| 424 |
+
"model.layers.21.self_attn.o_proj.scales": "model.safetensors",
|
| 425 |
+
"model.layers.21.self_attn.o_proj.weight": "model.safetensors",
|
| 426 |
+
"model.layers.21.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 427 |
+
"model.layers.21.self_attn.q_a_proj.biases": "model.safetensors",
|
| 428 |
+
"model.layers.21.self_attn.q_a_proj.scales": "model.safetensors",
|
| 429 |
+
"model.layers.21.self_attn.q_a_proj.weight": "model.safetensors",
|
| 430 |
+
"model.layers.21.self_attn.q_b_proj.biases": "model.safetensors",
|
| 431 |
+
"model.layers.21.self_attn.q_b_proj.scales": "model.safetensors",
|
| 432 |
+
"model.layers.21.self_attn.q_b_proj.weight": "model.safetensors",
|
| 433 |
+
"model.layers.22.input_layernorm.weight": "model.safetensors",
|
| 434 |
+
"model.layers.22.mlp.down_proj.biases": "model.safetensors",
|
| 435 |
+
"model.layers.22.mlp.down_proj.scales": "model.safetensors",
|
| 436 |
+
"model.layers.22.mlp.down_proj.weight": "model.safetensors",
|
| 437 |
+
"model.layers.22.mlp.gate_proj.biases": "model.safetensors",
|
| 438 |
+
"model.layers.22.mlp.gate_proj.scales": "model.safetensors",
|
| 439 |
+
"model.layers.22.mlp.gate_proj.weight": "model.safetensors",
|
| 440 |
+
"model.layers.22.mlp.up_proj.biases": "model.safetensors",
|
| 441 |
+
"model.layers.22.mlp.up_proj.scales": "model.safetensors",
|
| 442 |
+
"model.layers.22.mlp.up_proj.weight": "model.safetensors",
|
| 443 |
+
"model.layers.22.post_attention_layernorm.weight": "model.safetensors",
|
| 444 |
+
"model.layers.22.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 445 |
+
"model.layers.22.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 446 |
+
"model.layers.22.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 447 |
+
"model.layers.22.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 448 |
+
"model.layers.22.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 449 |
+
"model.layers.22.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 450 |
+
"model.layers.22.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 451 |
+
"model.layers.22.self_attn.o_proj.biases": "model.safetensors",
|
| 452 |
+
"model.layers.22.self_attn.o_proj.scales": "model.safetensors",
|
| 453 |
+
"model.layers.22.self_attn.o_proj.weight": "model.safetensors",
|
| 454 |
+
"model.layers.22.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 455 |
+
"model.layers.22.self_attn.q_a_proj.biases": "model.safetensors",
|
| 456 |
+
"model.layers.22.self_attn.q_a_proj.scales": "model.safetensors",
|
| 457 |
+
"model.layers.22.self_attn.q_a_proj.weight": "model.safetensors",
|
| 458 |
+
"model.layers.22.self_attn.q_b_proj.biases": "model.safetensors",
|
| 459 |
+
"model.layers.22.self_attn.q_b_proj.scales": "model.safetensors",
|
| 460 |
+
"model.layers.22.self_attn.q_b_proj.weight": "model.safetensors",
|
| 461 |
+
"model.layers.23.input_layernorm.weight": "model.safetensors",
|
| 462 |
+
"model.layers.23.mlp.down_proj.biases": "model.safetensors",
|
| 463 |
+
"model.layers.23.mlp.down_proj.scales": "model.safetensors",
|
| 464 |
+
"model.layers.23.mlp.down_proj.weight": "model.safetensors",
|
| 465 |
+
"model.layers.23.mlp.gate_proj.biases": "model.safetensors",
|
| 466 |
+
"model.layers.23.mlp.gate_proj.scales": "model.safetensors",
|
| 467 |
+
"model.layers.23.mlp.gate_proj.weight": "model.safetensors",
|
| 468 |
+
"model.layers.23.mlp.up_proj.biases": "model.safetensors",
|
| 469 |
+
"model.layers.23.mlp.up_proj.scales": "model.safetensors",
|
| 470 |
+
"model.layers.23.mlp.up_proj.weight": "model.safetensors",
|
| 471 |
+
"model.layers.23.post_attention_layernorm.weight": "model.safetensors",
|
| 472 |
+
"model.layers.23.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 473 |
+
"model.layers.23.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 474 |
+
"model.layers.23.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 475 |
+
"model.layers.23.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 476 |
+
"model.layers.23.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 477 |
+
"model.layers.23.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 478 |
+
"model.layers.23.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 479 |
+
"model.layers.23.self_attn.o_proj.biases": "model.safetensors",
|
| 480 |
+
"model.layers.23.self_attn.o_proj.scales": "model.safetensors",
|
| 481 |
+
"model.layers.23.self_attn.o_proj.weight": "model.safetensors",
|
| 482 |
+
"model.layers.23.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 483 |
+
"model.layers.23.self_attn.q_a_proj.biases": "model.safetensors",
|
| 484 |
+
"model.layers.23.self_attn.q_a_proj.scales": "model.safetensors",
|
| 485 |
+
"model.layers.23.self_attn.q_a_proj.weight": "model.safetensors",
|
| 486 |
+
"model.layers.23.self_attn.q_b_proj.biases": "model.safetensors",
|
| 487 |
+
"model.layers.23.self_attn.q_b_proj.scales": "model.safetensors",
|
| 488 |
+
"model.layers.23.self_attn.q_b_proj.weight": "model.safetensors",
|
| 489 |
+
"model.layers.24.input_layernorm.weight": "model.safetensors",
|
| 490 |
+
"model.layers.24.mlp.down_proj.biases": "model.safetensors",
|
| 491 |
+
"model.layers.24.mlp.down_proj.scales": "model.safetensors",
|
| 492 |
+
"model.layers.24.mlp.down_proj.weight": "model.safetensors",
|
| 493 |
+
"model.layers.24.mlp.gate_proj.biases": "model.safetensors",
|
| 494 |
+
"model.layers.24.mlp.gate_proj.scales": "model.safetensors",
|
| 495 |
+
"model.layers.24.mlp.gate_proj.weight": "model.safetensors",
|
| 496 |
+
"model.layers.24.mlp.up_proj.biases": "model.safetensors",
|
| 497 |
+
"model.layers.24.mlp.up_proj.scales": "model.safetensors",
|
| 498 |
+
"model.layers.24.mlp.up_proj.weight": "model.safetensors",
|
| 499 |
+
"model.layers.24.post_attention_layernorm.weight": "model.safetensors",
|
| 500 |
+
"model.layers.24.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 501 |
+
"model.layers.24.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 502 |
+
"model.layers.24.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 503 |
+
"model.layers.24.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 504 |
+
"model.layers.24.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 505 |
+
"model.layers.24.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 506 |
+
"model.layers.24.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 507 |
+
"model.layers.24.self_attn.o_proj.biases": "model.safetensors",
|
| 508 |
+
"model.layers.24.self_attn.o_proj.scales": "model.safetensors",
|
| 509 |
+
"model.layers.24.self_attn.o_proj.weight": "model.safetensors",
|
| 510 |
+
"model.layers.24.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 511 |
+
"model.layers.24.self_attn.q_a_proj.biases": "model.safetensors",
|
| 512 |
+
"model.layers.24.self_attn.q_a_proj.scales": "model.safetensors",
|
| 513 |
+
"model.layers.24.self_attn.q_a_proj.weight": "model.safetensors",
|
| 514 |
+
"model.layers.24.self_attn.q_b_proj.biases": "model.safetensors",
|
| 515 |
+
"model.layers.24.self_attn.q_b_proj.scales": "model.safetensors",
|
| 516 |
+
"model.layers.24.self_attn.q_b_proj.weight": "model.safetensors",
|
| 517 |
+
"model.layers.25.input_layernorm.weight": "model.safetensors",
|
| 518 |
+
"model.layers.25.mlp.down_proj.biases": "model.safetensors",
|
| 519 |
+
"model.layers.25.mlp.down_proj.scales": "model.safetensors",
|
| 520 |
+
"model.layers.25.mlp.down_proj.weight": "model.safetensors",
|
| 521 |
+
"model.layers.25.mlp.gate_proj.biases": "model.safetensors",
|
| 522 |
+
"model.layers.25.mlp.gate_proj.scales": "model.safetensors",
|
| 523 |
+
"model.layers.25.mlp.gate_proj.weight": "model.safetensors",
|
| 524 |
+
"model.layers.25.mlp.up_proj.biases": "model.safetensors",
|
| 525 |
+
"model.layers.25.mlp.up_proj.scales": "model.safetensors",
|
| 526 |
+
"model.layers.25.mlp.up_proj.weight": "model.safetensors",
|
| 527 |
+
"model.layers.25.post_attention_layernorm.weight": "model.safetensors",
|
| 528 |
+
"model.layers.25.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 529 |
+
"model.layers.25.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 530 |
+
"model.layers.25.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 531 |
+
"model.layers.25.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 532 |
+
"model.layers.25.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 533 |
+
"model.layers.25.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 534 |
+
"model.layers.25.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 535 |
+
"model.layers.25.self_attn.o_proj.biases": "model.safetensors",
|
| 536 |
+
"model.layers.25.self_attn.o_proj.scales": "model.safetensors",
|
| 537 |
+
"model.layers.25.self_attn.o_proj.weight": "model.safetensors",
|
| 538 |
+
"model.layers.25.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 539 |
+
"model.layers.25.self_attn.q_a_proj.biases": "model.safetensors",
|
| 540 |
+
"model.layers.25.self_attn.q_a_proj.scales": "model.safetensors",
|
| 541 |
+
"model.layers.25.self_attn.q_a_proj.weight": "model.safetensors",
|
| 542 |
+
"model.layers.25.self_attn.q_b_proj.biases": "model.safetensors",
|
| 543 |
+
"model.layers.25.self_attn.q_b_proj.scales": "model.safetensors",
|
| 544 |
+
"model.layers.25.self_attn.q_b_proj.weight": "model.safetensors",
|
| 545 |
+
"model.layers.26.input_layernorm.weight": "model.safetensors",
|
| 546 |
+
"model.layers.26.mlp.down_proj.biases": "model.safetensors",
|
| 547 |
+
"model.layers.26.mlp.down_proj.scales": "model.safetensors",
|
| 548 |
+
"model.layers.26.mlp.down_proj.weight": "model.safetensors",
|
| 549 |
+
"model.layers.26.mlp.gate_proj.biases": "model.safetensors",
|
| 550 |
+
"model.layers.26.mlp.gate_proj.scales": "model.safetensors",
|
| 551 |
+
"model.layers.26.mlp.gate_proj.weight": "model.safetensors",
|
| 552 |
+
"model.layers.26.mlp.up_proj.biases": "model.safetensors",
|
| 553 |
+
"model.layers.26.mlp.up_proj.scales": "model.safetensors",
|
| 554 |
+
"model.layers.26.mlp.up_proj.weight": "model.safetensors",
|
| 555 |
+
"model.layers.26.post_attention_layernorm.weight": "model.safetensors",
|
| 556 |
+
"model.layers.26.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 557 |
+
"model.layers.26.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 558 |
+
"model.layers.26.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 559 |
+
"model.layers.26.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 560 |
+
"model.layers.26.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 561 |
+
"model.layers.26.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 562 |
+
"model.layers.26.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 563 |
+
"model.layers.26.self_attn.o_proj.biases": "model.safetensors",
|
| 564 |
+
"model.layers.26.self_attn.o_proj.scales": "model.safetensors",
|
| 565 |
+
"model.layers.26.self_attn.o_proj.weight": "model.safetensors",
|
| 566 |
+
"model.layers.26.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 567 |
+
"model.layers.26.self_attn.q_a_proj.biases": "model.safetensors",
|
| 568 |
+
"model.layers.26.self_attn.q_a_proj.scales": "model.safetensors",
|
| 569 |
+
"model.layers.26.self_attn.q_a_proj.weight": "model.safetensors",
|
| 570 |
+
"model.layers.26.self_attn.q_b_proj.biases": "model.safetensors",
|
| 571 |
+
"model.layers.26.self_attn.q_b_proj.scales": "model.safetensors",
|
| 572 |
+
"model.layers.26.self_attn.q_b_proj.weight": "model.safetensors",
|
| 573 |
+
"model.layers.27.input_layernorm.weight": "model.safetensors",
|
| 574 |
+
"model.layers.27.mlp.down_proj.biases": "model.safetensors",
|
| 575 |
+
"model.layers.27.mlp.down_proj.scales": "model.safetensors",
|
| 576 |
+
"model.layers.27.mlp.down_proj.weight": "model.safetensors",
|
| 577 |
+
"model.layers.27.mlp.gate_proj.biases": "model.safetensors",
|
| 578 |
+
"model.layers.27.mlp.gate_proj.scales": "model.safetensors",
|
| 579 |
+
"model.layers.27.mlp.gate_proj.weight": "model.safetensors",
|
| 580 |
+
"model.layers.27.mlp.up_proj.biases": "model.safetensors",
|
| 581 |
+
"model.layers.27.mlp.up_proj.scales": "model.safetensors",
|
| 582 |
+
"model.layers.27.mlp.up_proj.weight": "model.safetensors",
|
| 583 |
+
"model.layers.27.post_attention_layernorm.weight": "model.safetensors",
|
| 584 |
+
"model.layers.27.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 585 |
+
"model.layers.27.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 586 |
+
"model.layers.27.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 587 |
+
"model.layers.27.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 588 |
+
"model.layers.27.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 589 |
+
"model.layers.27.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 590 |
+
"model.layers.27.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 591 |
+
"model.layers.27.self_attn.o_proj.biases": "model.safetensors",
|
| 592 |
+
"model.layers.27.self_attn.o_proj.scales": "model.safetensors",
|
| 593 |
+
"model.layers.27.self_attn.o_proj.weight": "model.safetensors",
|
| 594 |
+
"model.layers.27.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 595 |
+
"model.layers.27.self_attn.q_a_proj.biases": "model.safetensors",
|
| 596 |
+
"model.layers.27.self_attn.q_a_proj.scales": "model.safetensors",
|
| 597 |
+
"model.layers.27.self_attn.q_a_proj.weight": "model.safetensors",
|
| 598 |
+
"model.layers.27.self_attn.q_b_proj.biases": "model.safetensors",
|
| 599 |
+
"model.layers.27.self_attn.q_b_proj.scales": "model.safetensors",
|
| 600 |
+
"model.layers.27.self_attn.q_b_proj.weight": "model.safetensors",
|
| 601 |
+
"model.layers.28.input_layernorm.weight": "model.safetensors",
|
| 602 |
+
"model.layers.28.mlp.down_proj.biases": "model.safetensors",
|
| 603 |
+
"model.layers.28.mlp.down_proj.scales": "model.safetensors",
|
| 604 |
+
"model.layers.28.mlp.down_proj.weight": "model.safetensors",
|
| 605 |
+
"model.layers.28.mlp.gate_proj.biases": "model.safetensors",
|
| 606 |
+
"model.layers.28.mlp.gate_proj.scales": "model.safetensors",
|
| 607 |
+
"model.layers.28.mlp.gate_proj.weight": "model.safetensors",
|
| 608 |
+
"model.layers.28.mlp.up_proj.biases": "model.safetensors",
|
| 609 |
+
"model.layers.28.mlp.up_proj.scales": "model.safetensors",
|
| 610 |
+
"model.layers.28.mlp.up_proj.weight": "model.safetensors",
|
| 611 |
+
"model.layers.28.post_attention_layernorm.weight": "model.safetensors",
|
| 612 |
+
"model.layers.28.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 613 |
+
"model.layers.28.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 614 |
+
"model.layers.28.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 615 |
+
"model.layers.28.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 616 |
+
"model.layers.28.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 617 |
+
"model.layers.28.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 618 |
+
"model.layers.28.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 619 |
+
"model.layers.28.self_attn.o_proj.biases": "model.safetensors",
|
| 620 |
+
"model.layers.28.self_attn.o_proj.scales": "model.safetensors",
|
| 621 |
+
"model.layers.28.self_attn.o_proj.weight": "model.safetensors",
|
| 622 |
+
"model.layers.28.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 623 |
+
"model.layers.28.self_attn.q_a_proj.biases": "model.safetensors",
|
| 624 |
+
"model.layers.28.self_attn.q_a_proj.scales": "model.safetensors",
|
| 625 |
+
"model.layers.28.self_attn.q_a_proj.weight": "model.safetensors",
|
| 626 |
+
"model.layers.28.self_attn.q_b_proj.biases": "model.safetensors",
|
| 627 |
+
"model.layers.28.self_attn.q_b_proj.scales": "model.safetensors",
|
| 628 |
+
"model.layers.28.self_attn.q_b_proj.weight": "model.safetensors",
|
| 629 |
+
"model.layers.29.input_layernorm.weight": "model.safetensors",
|
| 630 |
+
"model.layers.29.mlp.down_proj.biases": "model.safetensors",
|
| 631 |
+
"model.layers.29.mlp.down_proj.scales": "model.safetensors",
|
| 632 |
+
"model.layers.29.mlp.down_proj.weight": "model.safetensors",
|
| 633 |
+
"model.layers.29.mlp.gate_proj.biases": "model.safetensors",
|
| 634 |
+
"model.layers.29.mlp.gate_proj.scales": "model.safetensors",
|
| 635 |
+
"model.layers.29.mlp.gate_proj.weight": "model.safetensors",
|
| 636 |
+
"model.layers.29.mlp.up_proj.biases": "model.safetensors",
|
| 637 |
+
"model.layers.29.mlp.up_proj.scales": "model.safetensors",
|
| 638 |
+
"model.layers.29.mlp.up_proj.weight": "model.safetensors",
|
| 639 |
+
"model.layers.29.post_attention_layernorm.weight": "model.safetensors",
|
| 640 |
+
"model.layers.29.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 641 |
+
"model.layers.29.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 642 |
+
"model.layers.29.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 643 |
+
"model.layers.29.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 644 |
+
"model.layers.29.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 645 |
+
"model.layers.29.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 646 |
+
"model.layers.29.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 647 |
+
"model.layers.29.self_attn.o_proj.biases": "model.safetensors",
|
| 648 |
+
"model.layers.29.self_attn.o_proj.scales": "model.safetensors",
|
| 649 |
+
"model.layers.29.self_attn.o_proj.weight": "model.safetensors",
|
| 650 |
+
"model.layers.29.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 651 |
+
"model.layers.29.self_attn.q_a_proj.biases": "model.safetensors",
|
| 652 |
+
"model.layers.29.self_attn.q_a_proj.scales": "model.safetensors",
|
| 653 |
+
"model.layers.29.self_attn.q_a_proj.weight": "model.safetensors",
|
| 654 |
+
"model.layers.29.self_attn.q_b_proj.biases": "model.safetensors",
|
| 655 |
+
"model.layers.29.self_attn.q_b_proj.scales": "model.safetensors",
|
| 656 |
+
"model.layers.29.self_attn.q_b_proj.weight": "model.safetensors",
|
| 657 |
+
"model.layers.3.input_layernorm.weight": "model.safetensors",
|
| 658 |
+
"model.layers.3.mlp.down_proj.biases": "model.safetensors",
|
| 659 |
+
"model.layers.3.mlp.down_proj.scales": "model.safetensors",
|
| 660 |
+
"model.layers.3.mlp.down_proj.weight": "model.safetensors",
|
| 661 |
+
"model.layers.3.mlp.gate_proj.biases": "model.safetensors",
|
| 662 |
+
"model.layers.3.mlp.gate_proj.scales": "model.safetensors",
|
| 663 |
+
"model.layers.3.mlp.gate_proj.weight": "model.safetensors",
|
| 664 |
+
"model.layers.3.mlp.up_proj.biases": "model.safetensors",
|
| 665 |
+
"model.layers.3.mlp.up_proj.scales": "model.safetensors",
|
| 666 |
+
"model.layers.3.mlp.up_proj.weight": "model.safetensors",
|
| 667 |
+
"model.layers.3.post_attention_layernorm.weight": "model.safetensors",
|
| 668 |
+
"model.layers.3.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 669 |
+
"model.layers.3.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 670 |
+
"model.layers.3.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 671 |
+
"model.layers.3.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 672 |
+
"model.layers.3.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 673 |
+
"model.layers.3.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 674 |
+
"model.layers.3.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 675 |
+
"model.layers.3.self_attn.o_proj.biases": "model.safetensors",
|
| 676 |
+
"model.layers.3.self_attn.o_proj.scales": "model.safetensors",
|
| 677 |
+
"model.layers.3.self_attn.o_proj.weight": "model.safetensors",
|
| 678 |
+
"model.layers.3.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 679 |
+
"model.layers.3.self_attn.q_a_proj.biases": "model.safetensors",
|
| 680 |
+
"model.layers.3.self_attn.q_a_proj.scales": "model.safetensors",
|
| 681 |
+
"model.layers.3.self_attn.q_a_proj.weight": "model.safetensors",
|
| 682 |
+
"model.layers.3.self_attn.q_b_proj.biases": "model.safetensors",
|
| 683 |
+
"model.layers.3.self_attn.q_b_proj.scales": "model.safetensors",
|
| 684 |
+
"model.layers.3.self_attn.q_b_proj.weight": "model.safetensors",
|
| 685 |
+
"model.layers.30.input_layernorm.weight": "model.safetensors",
|
| 686 |
+
"model.layers.30.mlp.down_proj.biases": "model.safetensors",
|
| 687 |
+
"model.layers.30.mlp.down_proj.scales": "model.safetensors",
|
| 688 |
+
"model.layers.30.mlp.down_proj.weight": "model.safetensors",
|
| 689 |
+
"model.layers.30.mlp.gate_proj.biases": "model.safetensors",
|
| 690 |
+
"model.layers.30.mlp.gate_proj.scales": "model.safetensors",
|
| 691 |
+
"model.layers.30.mlp.gate_proj.weight": "model.safetensors",
|
| 692 |
+
"model.layers.30.mlp.up_proj.biases": "model.safetensors",
|
| 693 |
+
"model.layers.30.mlp.up_proj.scales": "model.safetensors",
|
| 694 |
+
"model.layers.30.mlp.up_proj.weight": "model.safetensors",
|
| 695 |
+
"model.layers.30.post_attention_layernorm.weight": "model.safetensors",
|
| 696 |
+
"model.layers.30.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 697 |
+
"model.layers.30.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 698 |
+
"model.layers.30.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 699 |
+
"model.layers.30.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 700 |
+
"model.layers.30.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 701 |
+
"model.layers.30.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 702 |
+
"model.layers.30.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 703 |
+
"model.layers.30.self_attn.o_proj.biases": "model.safetensors",
|
| 704 |
+
"model.layers.30.self_attn.o_proj.scales": "model.safetensors",
|
| 705 |
+
"model.layers.30.self_attn.o_proj.weight": "model.safetensors",
|
| 706 |
+
"model.layers.30.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 707 |
+
"model.layers.30.self_attn.q_a_proj.biases": "model.safetensors",
|
| 708 |
+
"model.layers.30.self_attn.q_a_proj.scales": "model.safetensors",
|
| 709 |
+
"model.layers.30.self_attn.q_a_proj.weight": "model.safetensors",
|
| 710 |
+
"model.layers.30.self_attn.q_b_proj.biases": "model.safetensors",
|
| 711 |
+
"model.layers.30.self_attn.q_b_proj.scales": "model.safetensors",
|
| 712 |
+
"model.layers.30.self_attn.q_b_proj.weight": "model.safetensors",
|
| 713 |
+
"model.layers.31.input_layernorm.weight": "model.safetensors",
|
| 714 |
+
"model.layers.31.mlp.down_proj.biases": "model.safetensors",
|
| 715 |
+
"model.layers.31.mlp.down_proj.scales": "model.safetensors",
|
| 716 |
+
"model.layers.31.mlp.down_proj.weight": "model.safetensors",
|
| 717 |
+
"model.layers.31.mlp.gate_proj.biases": "model.safetensors",
|
| 718 |
+
"model.layers.31.mlp.gate_proj.scales": "model.safetensors",
|
| 719 |
+
"model.layers.31.mlp.gate_proj.weight": "model.safetensors",
|
| 720 |
+
"model.layers.31.mlp.up_proj.biases": "model.safetensors",
|
| 721 |
+
"model.layers.31.mlp.up_proj.scales": "model.safetensors",
|
| 722 |
+
"model.layers.31.mlp.up_proj.weight": "model.safetensors",
|
| 723 |
+
"model.layers.31.post_attention_layernorm.weight": "model.safetensors",
|
| 724 |
+
"model.layers.31.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 725 |
+
"model.layers.31.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 726 |
+
"model.layers.31.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 727 |
+
"model.layers.31.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 728 |
+
"model.layers.31.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 729 |
+
"model.layers.31.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 730 |
+
"model.layers.31.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 731 |
+
"model.layers.31.self_attn.o_proj.biases": "model.safetensors",
|
| 732 |
+
"model.layers.31.self_attn.o_proj.scales": "model.safetensors",
|
| 733 |
+
"model.layers.31.self_attn.o_proj.weight": "model.safetensors",
|
| 734 |
+
"model.layers.31.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 735 |
+
"model.layers.31.self_attn.q_a_proj.biases": "model.safetensors",
|
| 736 |
+
"model.layers.31.self_attn.q_a_proj.scales": "model.safetensors",
|
| 737 |
+
"model.layers.31.self_attn.q_a_proj.weight": "model.safetensors",
|
| 738 |
+
"model.layers.31.self_attn.q_b_proj.biases": "model.safetensors",
|
| 739 |
+
"model.layers.31.self_attn.q_b_proj.scales": "model.safetensors",
|
| 740 |
+
"model.layers.31.self_attn.q_b_proj.weight": "model.safetensors",
|
| 741 |
+
"model.layers.4.input_layernorm.weight": "model.safetensors",
|
| 742 |
+
"model.layers.4.mlp.down_proj.biases": "model.safetensors",
|
| 743 |
+
"model.layers.4.mlp.down_proj.scales": "model.safetensors",
|
| 744 |
+
"model.layers.4.mlp.down_proj.weight": "model.safetensors",
|
| 745 |
+
"model.layers.4.mlp.gate_proj.biases": "model.safetensors",
|
| 746 |
+
"model.layers.4.mlp.gate_proj.scales": "model.safetensors",
|
| 747 |
+
"model.layers.4.mlp.gate_proj.weight": "model.safetensors",
|
| 748 |
+
"model.layers.4.mlp.up_proj.biases": "model.safetensors",
|
| 749 |
+
"model.layers.4.mlp.up_proj.scales": "model.safetensors",
|
| 750 |
+
"model.layers.4.mlp.up_proj.weight": "model.safetensors",
|
| 751 |
+
"model.layers.4.post_attention_layernorm.weight": "model.safetensors",
|
| 752 |
+
"model.layers.4.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 753 |
+
"model.layers.4.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 754 |
+
"model.layers.4.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 755 |
+
"model.layers.4.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 756 |
+
"model.layers.4.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 757 |
+
"model.layers.4.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 758 |
+
"model.layers.4.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 759 |
+
"model.layers.4.self_attn.o_proj.biases": "model.safetensors",
|
| 760 |
+
"model.layers.4.self_attn.o_proj.scales": "model.safetensors",
|
| 761 |
+
"model.layers.4.self_attn.o_proj.weight": "model.safetensors",
|
| 762 |
+
"model.layers.4.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 763 |
+
"model.layers.4.self_attn.q_a_proj.biases": "model.safetensors",
|
| 764 |
+
"model.layers.4.self_attn.q_a_proj.scales": "model.safetensors",
|
| 765 |
+
"model.layers.4.self_attn.q_a_proj.weight": "model.safetensors",
|
| 766 |
+
"model.layers.4.self_attn.q_b_proj.biases": "model.safetensors",
|
| 767 |
+
"model.layers.4.self_attn.q_b_proj.scales": "model.safetensors",
|
| 768 |
+
"model.layers.4.self_attn.q_b_proj.weight": "model.safetensors",
|
| 769 |
+
"model.layers.5.input_layernorm.weight": "model.safetensors",
|
| 770 |
+
"model.layers.5.mlp.down_proj.biases": "model.safetensors",
|
| 771 |
+
"model.layers.5.mlp.down_proj.scales": "model.safetensors",
|
| 772 |
+
"model.layers.5.mlp.down_proj.weight": "model.safetensors",
|
| 773 |
+
"model.layers.5.mlp.gate_proj.biases": "model.safetensors",
|
| 774 |
+
"model.layers.5.mlp.gate_proj.scales": "model.safetensors",
|
| 775 |
+
"model.layers.5.mlp.gate_proj.weight": "model.safetensors",
|
| 776 |
+
"model.layers.5.mlp.up_proj.biases": "model.safetensors",
|
| 777 |
+
"model.layers.5.mlp.up_proj.scales": "model.safetensors",
|
| 778 |
+
"model.layers.5.mlp.up_proj.weight": "model.safetensors",
|
| 779 |
+
"model.layers.5.post_attention_layernorm.weight": "model.safetensors",
|
| 780 |
+
"model.layers.5.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 781 |
+
"model.layers.5.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 782 |
+
"model.layers.5.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 783 |
+
"model.layers.5.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 784 |
+
"model.layers.5.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 785 |
+
"model.layers.5.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 786 |
+
"model.layers.5.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 787 |
+
"model.layers.5.self_attn.o_proj.biases": "model.safetensors",
|
| 788 |
+
"model.layers.5.self_attn.o_proj.scales": "model.safetensors",
|
| 789 |
+
"model.layers.5.self_attn.o_proj.weight": "model.safetensors",
|
| 790 |
+
"model.layers.5.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 791 |
+
"model.layers.5.self_attn.q_a_proj.biases": "model.safetensors",
|
| 792 |
+
"model.layers.5.self_attn.q_a_proj.scales": "model.safetensors",
|
| 793 |
+
"model.layers.5.self_attn.q_a_proj.weight": "model.safetensors",
|
| 794 |
+
"model.layers.5.self_attn.q_b_proj.biases": "model.safetensors",
|
| 795 |
+
"model.layers.5.self_attn.q_b_proj.scales": "model.safetensors",
|
| 796 |
+
"model.layers.5.self_attn.q_b_proj.weight": "model.safetensors",
|
| 797 |
+
"model.layers.6.input_layernorm.weight": "model.safetensors",
|
| 798 |
+
"model.layers.6.mlp.down_proj.biases": "model.safetensors",
|
| 799 |
+
"model.layers.6.mlp.down_proj.scales": "model.safetensors",
|
| 800 |
+
"model.layers.6.mlp.down_proj.weight": "model.safetensors",
|
| 801 |
+
"model.layers.6.mlp.gate_proj.biases": "model.safetensors",
|
| 802 |
+
"model.layers.6.mlp.gate_proj.scales": "model.safetensors",
|
| 803 |
+
"model.layers.6.mlp.gate_proj.weight": "model.safetensors",
|
| 804 |
+
"model.layers.6.mlp.up_proj.biases": "model.safetensors",
|
| 805 |
+
"model.layers.6.mlp.up_proj.scales": "model.safetensors",
|
| 806 |
+
"model.layers.6.mlp.up_proj.weight": "model.safetensors",
|
| 807 |
+
"model.layers.6.post_attention_layernorm.weight": "model.safetensors",
|
| 808 |
+
"model.layers.6.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 809 |
+
"model.layers.6.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 810 |
+
"model.layers.6.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 811 |
+
"model.layers.6.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 812 |
+
"model.layers.6.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 813 |
+
"model.layers.6.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 814 |
+
"model.layers.6.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 815 |
+
"model.layers.6.self_attn.o_proj.biases": "model.safetensors",
|
| 816 |
+
"model.layers.6.self_attn.o_proj.scales": "model.safetensors",
|
| 817 |
+
"model.layers.6.self_attn.o_proj.weight": "model.safetensors",
|
| 818 |
+
"model.layers.6.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 819 |
+
"model.layers.6.self_attn.q_a_proj.biases": "model.safetensors",
|
| 820 |
+
"model.layers.6.self_attn.q_a_proj.scales": "model.safetensors",
|
| 821 |
+
"model.layers.6.self_attn.q_a_proj.weight": "model.safetensors",
|
| 822 |
+
"model.layers.6.self_attn.q_b_proj.biases": "model.safetensors",
|
| 823 |
+
"model.layers.6.self_attn.q_b_proj.scales": "model.safetensors",
|
| 824 |
+
"model.layers.6.self_attn.q_b_proj.weight": "model.safetensors",
|
| 825 |
+
"model.layers.7.input_layernorm.weight": "model.safetensors",
|
| 826 |
+
"model.layers.7.mlp.down_proj.biases": "model.safetensors",
|
| 827 |
+
"model.layers.7.mlp.down_proj.scales": "model.safetensors",
|
| 828 |
+
"model.layers.7.mlp.down_proj.weight": "model.safetensors",
|
| 829 |
+
"model.layers.7.mlp.gate_proj.biases": "model.safetensors",
|
| 830 |
+
"model.layers.7.mlp.gate_proj.scales": "model.safetensors",
|
| 831 |
+
"model.layers.7.mlp.gate_proj.weight": "model.safetensors",
|
| 832 |
+
"model.layers.7.mlp.up_proj.biases": "model.safetensors",
|
| 833 |
+
"model.layers.7.mlp.up_proj.scales": "model.safetensors",
|
| 834 |
+
"model.layers.7.mlp.up_proj.weight": "model.safetensors",
|
| 835 |
+
"model.layers.7.post_attention_layernorm.weight": "model.safetensors",
|
| 836 |
+
"model.layers.7.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 837 |
+
"model.layers.7.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 838 |
+
"model.layers.7.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 839 |
+
"model.layers.7.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 840 |
+
"model.layers.7.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 841 |
+
"model.layers.7.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 842 |
+
"model.layers.7.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 843 |
+
"model.layers.7.self_attn.o_proj.biases": "model.safetensors",
|
| 844 |
+
"model.layers.7.self_attn.o_proj.scales": "model.safetensors",
|
| 845 |
+
"model.layers.7.self_attn.o_proj.weight": "model.safetensors",
|
| 846 |
+
"model.layers.7.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 847 |
+
"model.layers.7.self_attn.q_a_proj.biases": "model.safetensors",
|
| 848 |
+
"model.layers.7.self_attn.q_a_proj.scales": "model.safetensors",
|
| 849 |
+
"model.layers.7.self_attn.q_a_proj.weight": "model.safetensors",
|
| 850 |
+
"model.layers.7.self_attn.q_b_proj.biases": "model.safetensors",
|
| 851 |
+
"model.layers.7.self_attn.q_b_proj.scales": "model.safetensors",
|
| 852 |
+
"model.layers.7.self_attn.q_b_proj.weight": "model.safetensors",
|
| 853 |
+
"model.layers.8.input_layernorm.weight": "model.safetensors",
|
| 854 |
+
"model.layers.8.mlp.down_proj.biases": "model.safetensors",
|
| 855 |
+
"model.layers.8.mlp.down_proj.scales": "model.safetensors",
|
| 856 |
+
"model.layers.8.mlp.down_proj.weight": "model.safetensors",
|
| 857 |
+
"model.layers.8.mlp.gate_proj.biases": "model.safetensors",
|
| 858 |
+
"model.layers.8.mlp.gate_proj.scales": "model.safetensors",
|
| 859 |
+
"model.layers.8.mlp.gate_proj.weight": "model.safetensors",
|
| 860 |
+
"model.layers.8.mlp.up_proj.biases": "model.safetensors",
|
| 861 |
+
"model.layers.8.mlp.up_proj.scales": "model.safetensors",
|
| 862 |
+
"model.layers.8.mlp.up_proj.weight": "model.safetensors",
|
| 863 |
+
"model.layers.8.post_attention_layernorm.weight": "model.safetensors",
|
| 864 |
+
"model.layers.8.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 865 |
+
"model.layers.8.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 866 |
+
"model.layers.8.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 867 |
+
"model.layers.8.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 868 |
+
"model.layers.8.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 869 |
+
"model.layers.8.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 870 |
+
"model.layers.8.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 871 |
+
"model.layers.8.self_attn.o_proj.biases": "model.safetensors",
|
| 872 |
+
"model.layers.8.self_attn.o_proj.scales": "model.safetensors",
|
| 873 |
+
"model.layers.8.self_attn.o_proj.weight": "model.safetensors",
|
| 874 |
+
"model.layers.8.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 875 |
+
"model.layers.8.self_attn.q_a_proj.biases": "model.safetensors",
|
| 876 |
+
"model.layers.8.self_attn.q_a_proj.scales": "model.safetensors",
|
| 877 |
+
"model.layers.8.self_attn.q_a_proj.weight": "model.safetensors",
|
| 878 |
+
"model.layers.8.self_attn.q_b_proj.biases": "model.safetensors",
|
| 879 |
+
"model.layers.8.self_attn.q_b_proj.scales": "model.safetensors",
|
| 880 |
+
"model.layers.8.self_attn.q_b_proj.weight": "model.safetensors",
|
| 881 |
+
"model.layers.9.input_layernorm.weight": "model.safetensors",
|
| 882 |
+
"model.layers.9.mlp.down_proj.biases": "model.safetensors",
|
| 883 |
+
"model.layers.9.mlp.down_proj.scales": "model.safetensors",
|
| 884 |
+
"model.layers.9.mlp.down_proj.weight": "model.safetensors",
|
| 885 |
+
"model.layers.9.mlp.gate_proj.biases": "model.safetensors",
|
| 886 |
+
"model.layers.9.mlp.gate_proj.scales": "model.safetensors",
|
| 887 |
+
"model.layers.9.mlp.gate_proj.weight": "model.safetensors",
|
| 888 |
+
"model.layers.9.mlp.up_proj.biases": "model.safetensors",
|
| 889 |
+
"model.layers.9.mlp.up_proj.scales": "model.safetensors",
|
| 890 |
+
"model.layers.9.mlp.up_proj.weight": "model.safetensors",
|
| 891 |
+
"model.layers.9.post_attention_layernorm.weight": "model.safetensors",
|
| 892 |
+
"model.layers.9.self_attn.kv_a_layernorm.weight": "model.safetensors",
|
| 893 |
+
"model.layers.9.self_attn.kv_a_proj_with_mqa.biases": "model.safetensors",
|
| 894 |
+
"model.layers.9.self_attn.kv_a_proj_with_mqa.scales": "model.safetensors",
|
| 895 |
+
"model.layers.9.self_attn.kv_a_proj_with_mqa.weight": "model.safetensors",
|
| 896 |
+
"model.layers.9.self_attn.kv_b_proj.biases": "model.safetensors",
|
| 897 |
+
"model.layers.9.self_attn.kv_b_proj.scales": "model.safetensors",
|
| 898 |
+
"model.layers.9.self_attn.kv_b_proj.weight": "model.safetensors",
|
| 899 |
+
"model.layers.9.self_attn.o_proj.biases": "model.safetensors",
|
| 900 |
+
"model.layers.9.self_attn.o_proj.scales": "model.safetensors",
|
| 901 |
+
"model.layers.9.self_attn.o_proj.weight": "model.safetensors",
|
| 902 |
+
"model.layers.9.self_attn.q_a_layernorm.weight": "model.safetensors",
|
| 903 |
+
"model.layers.9.self_attn.q_a_proj.biases": "model.safetensors",
|
| 904 |
+
"model.layers.9.self_attn.q_a_proj.scales": "model.safetensors",
|
| 905 |
+
"model.layers.9.self_attn.q_a_proj.weight": "model.safetensors",
|
| 906 |
+
"model.layers.9.self_attn.q_b_proj.biases": "model.safetensors",
|
| 907 |
+
"model.layers.9.self_attn.q_b_proj.scales": "model.safetensors",
|
| 908 |
+
"model.layers.9.self_attn.q_b_proj.weight": "model.safetensors",
|
| 909 |
+
"model.norm.weight": "model.safetensors"
|
| 910 |
+
}
|
| 911 |
+
}
|
modeling_youtu.py
ADDED
|
@@ -0,0 +1,610 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# coding=utf-8
|
| 2 |
+
# Copyright 2025 Tencent Youtu lab, DeepSeek-AI and The HuggingFace Inc. team. All rights reserved.
|
| 3 |
+
#
|
| 4 |
+
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
|
| 5 |
+
# and OPT implementations in this library. It has been modified from its
|
| 6 |
+
# original forms to accommodate minor architectural differences compared
|
| 7 |
+
# to GPT-NeoX and OPT used by the Meta AI team that trained the model.
|
| 8 |
+
#
|
| 9 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 10 |
+
# you may not use this file except in compliance with the License.
|
| 11 |
+
# You may obtain a copy of the License at
|
| 12 |
+
#
|
| 13 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 14 |
+
#
|
| 15 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 16 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 17 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 18 |
+
# See the License for the specific language governing permissions and
|
| 19 |
+
# limitations under the License.
|
| 20 |
+
import math
|
| 21 |
+
from typing import Callable, Optional, Union
|
| 22 |
+
|
| 23 |
+
import torch
|
| 24 |
+
import torch.nn.functional as F
|
| 25 |
+
from torch import nn
|
| 26 |
+
|
| 27 |
+
from transformers.activations import ACT2FN
|
| 28 |
+
from transformers.cache_utils import Cache, DynamicCache
|
| 29 |
+
from transformers.generation import GenerationMixin
|
| 30 |
+
from transformers.integrations import use_kernel_forward_from_hub
|
| 31 |
+
from transformers.masking_utils import create_causal_mask
|
| 32 |
+
from transformers.modeling_flash_attention_utils import FlashAttentionKwargs
|
| 33 |
+
from transformers.modeling_layers import GradientCheckpointingLayer
|
| 34 |
+
from transformers.modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast
|
| 35 |
+
from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_update
|
| 36 |
+
from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
|
| 37 |
+
from transformers.processing_utils import Unpack
|
| 38 |
+
from transformers.utils import TransformersKwargs, auto_docstring, can_return_tuple
|
| 39 |
+
from transformers.utils.deprecation import deprecate_kwarg
|
| 40 |
+
from transformers.utils.generic import check_model_inputs
|
| 41 |
+
from .configuration_youtu import YoutuConfig
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
@use_kernel_forward_from_hub("RMSNorm")
|
| 45 |
+
class YoutuRMSNorm(nn.Module):
|
| 46 |
+
def __init__(self, hidden_size, eps=1e-6):
|
| 47 |
+
"""
|
| 48 |
+
YoutuRMSNorm is equivalent to T5LayerNorm
|
| 49 |
+
"""
|
| 50 |
+
super().__init__()
|
| 51 |
+
self.weight = nn.Parameter(torch.ones(hidden_size))
|
| 52 |
+
self.variance_epsilon = eps
|
| 53 |
+
|
| 54 |
+
def forward(self, hidden_states):
|
| 55 |
+
input_dtype = hidden_states.dtype
|
| 56 |
+
hidden_states = hidden_states.to(torch.float32)
|
| 57 |
+
variance = hidden_states.pow(2).mean(-1, keepdim=True)
|
| 58 |
+
hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
|
| 59 |
+
return self.weight * hidden_states.to(input_dtype)
|
| 60 |
+
|
| 61 |
+
def extra_repr(self):
|
| 62 |
+
return f"{tuple(self.weight.shape)}, eps={self.variance_epsilon}"
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
class YoutuRotaryEmbedding(nn.Module):
|
| 66 |
+
inv_freq: torch.Tensor # fix linting for `register_buffer`
|
| 67 |
+
|
| 68 |
+
def __init__(self, config: YoutuConfig, device=None):
|
| 69 |
+
super().__init__()
|
| 70 |
+
# BC: "rope_type" was originally "type"
|
| 71 |
+
if hasattr(config, "rope_scaling") and config.rope_scaling is not None:
|
| 72 |
+
self.rope_type = config.rope_scaling.get("rope_type", config.rope_scaling.get("type"))
|
| 73 |
+
else:
|
| 74 |
+
self.rope_type = "default"
|
| 75 |
+
self.max_seq_len_cached = config.max_position_embeddings
|
| 76 |
+
self.original_max_seq_len = config.max_position_embeddings
|
| 77 |
+
|
| 78 |
+
self.config = config
|
| 79 |
+
self.rope_init_fn = ROPE_INIT_FUNCTIONS[self.rope_type]
|
| 80 |
+
|
| 81 |
+
inv_freq, self.attention_scaling = self.rope_init_fn(self.config, device)
|
| 82 |
+
self.register_buffer("inv_freq", inv_freq, persistent=False)
|
| 83 |
+
self.original_inv_freq = self.inv_freq
|
| 84 |
+
|
| 85 |
+
@torch.no_grad()
|
| 86 |
+
@dynamic_rope_update # power user: used with advanced RoPE types (e.g. dynamic rope)
|
| 87 |
+
def forward(self, x, position_ids):
|
| 88 |
+
inv_freq_expanded = self.inv_freq[None, :, None].float().expand(position_ids.shape[0], -1, 1).to(x.device)
|
| 89 |
+
position_ids_expanded = position_ids[:, None, :].float()
|
| 90 |
+
|
| 91 |
+
device_type = x.device.type if isinstance(x.device.type, str) and x.device.type != "mps" else "cpu"
|
| 92 |
+
with torch.autocast(device_type=device_type, enabled=False): # Force float32
|
| 93 |
+
freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
|
| 94 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
| 95 |
+
cos = emb.cos() * self.attention_scaling
|
| 96 |
+
sin = emb.sin() * self.attention_scaling
|
| 97 |
+
|
| 98 |
+
return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
class YoutuMLP(nn.Module):
|
| 102 |
+
def __init__(self, config, hidden_size=None, intermediate_size=None):
|
| 103 |
+
super().__init__()
|
| 104 |
+
self.config = config
|
| 105 |
+
self.hidden_size = config.hidden_size if hidden_size is None else hidden_size
|
| 106 |
+
self.intermediate_size = config.intermediate_size if intermediate_size is None else intermediate_size
|
| 107 |
+
self.mlp_bias = config.mlp_bias
|
| 108 |
+
|
| 109 |
+
self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=self.mlp_bias)
|
| 110 |
+
self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=self.mlp_bias)
|
| 111 |
+
self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=self.mlp_bias)
|
| 112 |
+
self.act_fn = ACT2FN[config.hidden_act]
|
| 113 |
+
|
| 114 |
+
def forward(self, x):
|
| 115 |
+
down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
|
| 116 |
+
return down_proj
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
def rotate_half(x):
|
| 120 |
+
"""Rotates half the hidden dims of the input."""
|
| 121 |
+
x1 = x[..., : x.shape[-1] // 2]
|
| 122 |
+
x2 = x[..., x.shape[-1] // 2 :]
|
| 123 |
+
return torch.cat((-x2, x1), dim=-1)
|
| 124 |
+
|
| 125 |
+
|
| 126 |
+
def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_dim=1):
|
| 127 |
+
"""Applies Rotary Position Embedding to the query and key tensors.
|
| 128 |
+
|
| 129 |
+
Args:
|
| 130 |
+
q (`torch.Tensor`): The query tensor.
|
| 131 |
+
k (`torch.Tensor`): The key tensor.
|
| 132 |
+
cos (`torch.Tensor`): The cosine part of the rotary embedding.
|
| 133 |
+
sin (`torch.Tensor`): The sine part of the rotary embedding.
|
| 134 |
+
position_ids (`torch.Tensor`, *optional*):
|
| 135 |
+
Deprecated and unused.
|
| 136 |
+
unsqueeze_dim (`int`, *optional*, defaults to 1):
|
| 137 |
+
The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
|
| 138 |
+
sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
|
| 139 |
+
that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
|
| 140 |
+
k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
|
| 141 |
+
cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
|
| 142 |
+
the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
|
| 143 |
+
Returns:
|
| 144 |
+
`tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
|
| 145 |
+
"""
|
| 146 |
+
cos = cos.unsqueeze(unsqueeze_dim)
|
| 147 |
+
sin = sin.unsqueeze(unsqueeze_dim)
|
| 148 |
+
q_embed = (q * cos) + (rotate_half(q) * sin)
|
| 149 |
+
k_embed = (k * cos) + (rotate_half(k) * sin)
|
| 150 |
+
return q_embed, k_embed
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
|
| 154 |
+
"""
|
| 155 |
+
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
|
| 156 |
+
num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
|
| 157 |
+
"""
|
| 158 |
+
batch, num_key_value_heads, slen, head_dim = hidden_states.shape
|
| 159 |
+
if n_rep == 1:
|
| 160 |
+
return hidden_states
|
| 161 |
+
hidden_states = hidden_states[:, :, None, :, :].expand(batch, num_key_value_heads, n_rep, slen, head_dim)
|
| 162 |
+
return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
|
| 163 |
+
|
| 164 |
+
|
| 165 |
+
def eager_attention_forward(
|
| 166 |
+
module: nn.Module,
|
| 167 |
+
query: torch.Tensor,
|
| 168 |
+
key: torch.Tensor,
|
| 169 |
+
value: torch.Tensor,
|
| 170 |
+
attention_mask: Optional[torch.Tensor],
|
| 171 |
+
scaling: float,
|
| 172 |
+
dropout: float = 0.0,
|
| 173 |
+
**kwargs: Unpack[TransformersKwargs],
|
| 174 |
+
):
|
| 175 |
+
key_states = repeat_kv(key, module.num_key_value_groups)
|
| 176 |
+
value_states = repeat_kv(value, module.num_key_value_groups)
|
| 177 |
+
|
| 178 |
+
attn_weights = torch.matmul(query, key_states.transpose(2, 3)) * scaling
|
| 179 |
+
if attention_mask is not None:
|
| 180 |
+
causal_mask = attention_mask[:, :, :, : key_states.shape[-2]]
|
| 181 |
+
attn_weights = attn_weights + causal_mask
|
| 182 |
+
|
| 183 |
+
attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(query.dtype)
|
| 184 |
+
attn_weights = nn.functional.dropout(attn_weights, p=dropout, training=module.training)
|
| 185 |
+
attn_output = torch.matmul(attn_weights, value_states)
|
| 186 |
+
attn_output = attn_output.transpose(1, 2).contiguous()
|
| 187 |
+
|
| 188 |
+
return attn_output, attn_weights
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
def apply_rotary_pos_emb_interleave(q, k, cos, sin, position_ids=None, unsqueeze_dim=1):
|
| 192 |
+
r"""
|
| 193 |
+
TODO let's just use the original freqcis computation to not have the view
|
| 194 |
+
transpose + reshape! This is not optimized!
|
| 195 |
+
Applies Rotary Position Embedding to the query and key tensors.
|
| 196 |
+
|
| 197 |
+
Args:
|
| 198 |
+
q (`torch.Tensor`): The query tensor.
|
| 199 |
+
k (`torch.Tensor`): The key tensor.
|
| 200 |
+
cos (`torch.Tensor`): The cosine part of the rotary embedding.
|
| 201 |
+
sin (`torch.Tensor`): The sine part of the rotary embedding.
|
| 202 |
+
position_ids (`torch.Tensor`):
|
| 203 |
+
The position indices of the tokens corresponding to the query and key tensors. For example, this can be
|
| 204 |
+
used to pass offsetted position ids when working with a KV-cache.
|
| 205 |
+
unsqueeze_dim (`int`, *optional*, defaults to 1):
|
| 206 |
+
The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
|
| 207 |
+
sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
|
| 208 |
+
that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
|
| 209 |
+
k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
|
| 210 |
+
cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
|
| 211 |
+
the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
|
| 212 |
+
Returns:
|
| 213 |
+
`tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
|
| 214 |
+
"""
|
| 215 |
+
cos = cos.unsqueeze(unsqueeze_dim)
|
| 216 |
+
sin = sin.unsqueeze(unsqueeze_dim)
|
| 217 |
+
|
| 218 |
+
b, h, s, d = q.shape
|
| 219 |
+
q = q.view(b, h, s, d // 2, 2).transpose(4, 3).reshape(b, h, s, d)
|
| 220 |
+
|
| 221 |
+
b, h, s, d = k.shape
|
| 222 |
+
k = k.view(b, h, s, d // 2, 2).transpose(4, 3).reshape(b, h, s, d)
|
| 223 |
+
|
| 224 |
+
q_embed = (q * cos) + (rotate_half(q) * sin)
|
| 225 |
+
k_embed = (k * cos) + (rotate_half(k) * sin)
|
| 226 |
+
return q_embed, k_embed
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
def yarn_get_mscale(scale=1, mscale=1):
|
| 230 |
+
if scale <= 1:
|
| 231 |
+
return 1.0
|
| 232 |
+
return 0.1 * mscale * math.log(scale) + 1.0
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
class YoutuMLAttention(nn.Module):
|
| 236 |
+
"""Multi-latent attention from 'DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model' paper"""
|
| 237 |
+
|
| 238 |
+
def __init__(self, config: YoutuConfig, layer_idx: int):
|
| 239 |
+
super().__init__()
|
| 240 |
+
self.config = config
|
| 241 |
+
self.layer_idx = layer_idx
|
| 242 |
+
self.num_key_value_groups = config.num_attention_heads // config.num_key_value_heads
|
| 243 |
+
self.attention_dropout = config.attention_dropout
|
| 244 |
+
self.num_heads = config.num_attention_heads
|
| 245 |
+
self.rope_theta = config.rope_theta
|
| 246 |
+
self.q_lora_rank = config.q_lora_rank
|
| 247 |
+
self.qk_rope_head_dim = config.qk_rope_head_dim
|
| 248 |
+
self.kv_lora_rank = config.kv_lora_rank
|
| 249 |
+
self.v_head_dim = config.v_head_dim
|
| 250 |
+
self.qk_nope_head_dim = config.qk_nope_head_dim
|
| 251 |
+
self.qk_head_dim = config.qk_head_dim
|
| 252 |
+
|
| 253 |
+
self.is_causal = True
|
| 254 |
+
if self.q_lora_rank is None:
|
| 255 |
+
self.q_proj = nn.Linear(config.hidden_size, self.num_heads * self.qk_head_dim, bias=False)
|
| 256 |
+
else:
|
| 257 |
+
self.q_a_proj = nn.Linear(config.hidden_size, config.q_lora_rank, bias=config.attention_bias)
|
| 258 |
+
self.q_a_layernorm = YoutuRMSNorm(config.q_lora_rank)
|
| 259 |
+
self.q_b_proj = nn.Linear(config.q_lora_rank, self.num_heads * self.qk_head_dim, bias=False)
|
| 260 |
+
|
| 261 |
+
self.kv_a_proj_with_mqa = nn.Linear(
|
| 262 |
+
config.hidden_size,
|
| 263 |
+
self.kv_lora_rank + self.qk_rope_head_dim,
|
| 264 |
+
bias=config.attention_bias,
|
| 265 |
+
)
|
| 266 |
+
self.kv_a_layernorm = YoutuRMSNorm(self.kv_lora_rank)
|
| 267 |
+
self.kv_b_proj = nn.Linear(
|
| 268 |
+
self.kv_lora_rank,
|
| 269 |
+
self.num_heads * (self.qk_nope_head_dim + self.v_head_dim),
|
| 270 |
+
bias=False,
|
| 271 |
+
)
|
| 272 |
+
|
| 273 |
+
self.o_proj = nn.Linear(
|
| 274 |
+
self.num_heads * self.v_head_dim,
|
| 275 |
+
config.hidden_size,
|
| 276 |
+
bias=config.attention_bias,
|
| 277 |
+
)
|
| 278 |
+
|
| 279 |
+
self.scaling = self.qk_head_dim ** (-0.5)
|
| 280 |
+
if self.config.rope_scaling is not None:
|
| 281 |
+
mscale_all_dim = self.config.rope_scaling.get("mscale_all_dim", 0)
|
| 282 |
+
scaling_factor = self.config.rope_scaling["factor"]
|
| 283 |
+
if mscale_all_dim:
|
| 284 |
+
mscale = yarn_get_mscale(scaling_factor, mscale_all_dim)
|
| 285 |
+
self.scaling = self.scaling * mscale * mscale
|
| 286 |
+
|
| 287 |
+
@deprecate_kwarg("past_key_value", new_name="past_key_values", version="4.58")
|
| 288 |
+
def forward(
|
| 289 |
+
self,
|
| 290 |
+
hidden_states: torch.Tensor,
|
| 291 |
+
position_embeddings: tuple[torch.Tensor, torch.Tensor],
|
| 292 |
+
attention_mask: Optional[torch.Tensor],
|
| 293 |
+
past_key_values: Optional[Cache] = None,
|
| 294 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 295 |
+
**kwargs: Unpack[FlashAttentionKwargs],
|
| 296 |
+
) -> tuple[torch.Tensor, Optional[torch.Tensor], Optional[tuple[torch.Tensor]]]:
|
| 297 |
+
batch_size, seq_length = hidden_states.shape[:-1]
|
| 298 |
+
query_shape = (batch_size, seq_length, -1, self.qk_head_dim)
|
| 299 |
+
key_shape = (batch_size, seq_length, -1, self.qk_nope_head_dim + self.v_head_dim)
|
| 300 |
+
|
| 301 |
+
if self.q_lora_rank is None:
|
| 302 |
+
q_states = self.q_proj(hidden_states)
|
| 303 |
+
else:
|
| 304 |
+
q_states = self.q_b_proj(self.q_a_layernorm(self.q_a_proj(hidden_states)))
|
| 305 |
+
q_states = q_states.view(query_shape).transpose(1, 2)
|
| 306 |
+
q_pass, q_rot = torch.split(q_states, [self.qk_nope_head_dim, self.qk_rope_head_dim], dim=-1)
|
| 307 |
+
|
| 308 |
+
compressed_kv = self.kv_a_proj_with_mqa(hidden_states)
|
| 309 |
+
k_pass, k_rot = torch.split(compressed_kv, [self.kv_lora_rank, self.qk_rope_head_dim], dim=-1)
|
| 310 |
+
|
| 311 |
+
k_pass = self.kv_b_proj(self.kv_a_layernorm(k_pass)).view(key_shape).transpose(1, 2)
|
| 312 |
+
k_pass, value_states = torch.split(k_pass, [self.qk_nope_head_dim, self.v_head_dim], dim=-1)
|
| 313 |
+
|
| 314 |
+
k_rot = k_rot.view(batch_size, 1, seq_length, self.qk_rope_head_dim)
|
| 315 |
+
|
| 316 |
+
cos, sin = position_embeddings
|
| 317 |
+
if self.config.rope_interleave: # support using interleaved weights for efficiency
|
| 318 |
+
q_rot, k_rot = apply_rotary_pos_emb_interleave(q_rot, k_rot, cos, sin)
|
| 319 |
+
else:
|
| 320 |
+
q_rot, k_rot = apply_rotary_pos_emb(q_rot, k_rot, cos, sin)
|
| 321 |
+
k_rot = k_rot.expand(*k_pass.shape[:-1], -1)
|
| 322 |
+
|
| 323 |
+
query_states = torch.cat((q_pass, q_rot), dim=-1)
|
| 324 |
+
key_states = torch.cat((k_pass, k_rot), dim=-1)
|
| 325 |
+
|
| 326 |
+
if past_key_values is not None:
|
| 327 |
+
# sin and cos are specific to RoPE models; cache_position needed for the static cache
|
| 328 |
+
cache_kwargs = {"sin": sin, "cos": cos, "cache_position": cache_position}
|
| 329 |
+
key_states, value_states = past_key_values.update(key_states, value_states, self.layer_idx, cache_kwargs)
|
| 330 |
+
|
| 331 |
+
if self.config._attn_implementation == "flash_attention_2" and self.qk_head_dim != self.v_head_dim:
|
| 332 |
+
value_states = F.pad(value_states, [0, self.qk_head_dim - self.v_head_dim])
|
| 333 |
+
|
| 334 |
+
attention_interface: Callable = eager_attention_forward
|
| 335 |
+
if self.config._attn_implementation != "eager":
|
| 336 |
+
attention_interface = ALL_ATTENTION_FUNCTIONS[self.config._attn_implementation]
|
| 337 |
+
|
| 338 |
+
attn_output, attn_weights = attention_interface(
|
| 339 |
+
self,
|
| 340 |
+
query_states,
|
| 341 |
+
key_states,
|
| 342 |
+
value_states,
|
| 343 |
+
attention_mask,
|
| 344 |
+
dropout=0.0 if not self.training else self.attention_dropout,
|
| 345 |
+
scaling=self.scaling,
|
| 346 |
+
**kwargs,
|
| 347 |
+
)
|
| 348 |
+
|
| 349 |
+
if self.config._attn_implementation == "flash_attention_2" and self.qk_head_dim != self.v_head_dim:
|
| 350 |
+
attn_output = attn_output[:, :, :, : self.v_head_dim]
|
| 351 |
+
|
| 352 |
+
attn_output = attn_output.reshape(batch_size, seq_length, -1).contiguous()
|
| 353 |
+
attn_output = self.o_proj(attn_output)
|
| 354 |
+
return attn_output, attn_weights
|
| 355 |
+
|
| 356 |
+
|
| 357 |
+
class YoutuDecoderLayer(GradientCheckpointingLayer):
|
| 358 |
+
def __init__(self, config: YoutuConfig, layer_idx: int):
|
| 359 |
+
super().__init__()
|
| 360 |
+
self.hidden_size = config.hidden_size
|
| 361 |
+
self.self_attn = YoutuMLAttention(config=config, layer_idx=layer_idx)
|
| 362 |
+
self.mlp = YoutuMLP(config)
|
| 363 |
+
self.input_layernorm = YoutuRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
| 364 |
+
self.post_attention_layernorm = YoutuRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
| 365 |
+
|
| 366 |
+
@deprecate_kwarg("past_key_value", new_name="past_key_values", version="4.58")
|
| 367 |
+
def forward(
|
| 368 |
+
self,
|
| 369 |
+
hidden_states: torch.Tensor,
|
| 370 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 371 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 372 |
+
past_key_values: Optional[Cache] = None,
|
| 373 |
+
use_cache: Optional[bool] = False,
|
| 374 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 375 |
+
position_embeddings: Optional[tuple[torch.Tensor, torch.Tensor]] = None, # necessary, but kept here for BC
|
| 376 |
+
**kwargs: Unpack[TransformersKwargs],
|
| 377 |
+
) -> torch.Tensor:
|
| 378 |
+
residual = hidden_states
|
| 379 |
+
hidden_states = self.input_layernorm(hidden_states)
|
| 380 |
+
# Self Attention
|
| 381 |
+
hidden_states, _ = self.self_attn(
|
| 382 |
+
hidden_states=hidden_states,
|
| 383 |
+
attention_mask=attention_mask,
|
| 384 |
+
position_ids=position_ids,
|
| 385 |
+
past_key_values=past_key_values,
|
| 386 |
+
use_cache=use_cache,
|
| 387 |
+
cache_position=cache_position,
|
| 388 |
+
position_embeddings=position_embeddings,
|
| 389 |
+
**kwargs,
|
| 390 |
+
)
|
| 391 |
+
hidden_states = residual + hidden_states
|
| 392 |
+
|
| 393 |
+
# Fully Connected
|
| 394 |
+
residual = hidden_states
|
| 395 |
+
hidden_states = self.post_attention_layernorm(hidden_states)
|
| 396 |
+
hidden_states = self.mlp(hidden_states)
|
| 397 |
+
hidden_states = residual + hidden_states
|
| 398 |
+
return hidden_states
|
| 399 |
+
|
| 400 |
+
@auto_docstring
|
| 401 |
+
class YoutuPreTrainedModel(PreTrainedModel):
|
| 402 |
+
config: YoutuConfig
|
| 403 |
+
base_model_prefix = "model"
|
| 404 |
+
supports_gradient_checkpointing = True
|
| 405 |
+
_no_split_modules = ["YoutuDecoderLayer"]
|
| 406 |
+
_skip_keys_device_placement = ["past_key_values"]
|
| 407 |
+
_supports_flash_attn = True
|
| 408 |
+
_supports_sdpa = True
|
| 409 |
+
_supports_flex_attn = True
|
| 410 |
+
_can_compile_fullgraph = False
|
| 411 |
+
_supports_attention_backend = True
|
| 412 |
+
_can_record_outputs = {
|
| 413 |
+
"hidden_states": YoutuDecoderLayer,
|
| 414 |
+
"attentions": YoutuMLAttention,
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
def init_weights(self):
|
| 418 |
+
"""
|
| 419 |
+
If needed prunes and maybe initializes weights. If using a custom `PreTrainedModel`, you need to implement any
|
| 420 |
+
initialization logic in `_init_weights`.
|
| 421 |
+
"""
|
| 422 |
+
# Prune heads if needed
|
| 423 |
+
if self.config.pruned_heads:
|
| 424 |
+
self.prune_heads(self.config.pruned_heads)
|
| 425 |
+
|
| 426 |
+
if "-init" in self.name_or_path:
|
| 427 |
+
# Initialize weights
|
| 428 |
+
self.apply(self._initialize_weights)
|
| 429 |
+
|
| 430 |
+
# Adjust weights of o_proj in Attention and down_proj in MLP
|
| 431 |
+
for name, module in self.named_modules():
|
| 432 |
+
if "o_proj" in name or "down_proj" in name:
|
| 433 |
+
# For the output projection, we reinitialize the weights
|
| 434 |
+
scaled_std = self.config.initializer_range * (1.0 / self.config.num_hidden_layers) ** 0.5
|
| 435 |
+
module.weight.data.normal_(mean=0.0, std=scaled_std)
|
| 436 |
+
|
| 437 |
+
# Tie weights should be skipped when not initializing all weights
|
| 438 |
+
# since from_pretrained(...) calls tie weights anyways
|
| 439 |
+
self.tie_weights()
|
| 440 |
+
|
| 441 |
+
def _init_weights(self, module):
|
| 442 |
+
super()._init_weights(module)
|
| 443 |
+
std = self.config.initializer_range
|
| 444 |
+
embedding_std = self.config.embedding_initializer_range
|
| 445 |
+
if isinstance(module, nn.Linear):
|
| 446 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
| 447 |
+
if module.bias is not None:
|
| 448 |
+
module.bias.data.zero_()
|
| 449 |
+
elif isinstance(module, nn.Embedding):
|
| 450 |
+
module.weight.data.normal_(mean=0.0, std=embedding_std)
|
| 451 |
+
if module.padding_idx is not None:
|
| 452 |
+
module.weight.data[module.padding_idx].zero_()
|
| 453 |
+
|
| 454 |
+
@auto_docstring
|
| 455 |
+
class YoutuModel(YoutuPreTrainedModel):
|
| 456 |
+
_keys_to_ignore_on_load_unexpected = [""]
|
| 457 |
+
|
| 458 |
+
def __init__(self, config: YoutuConfig):
|
| 459 |
+
super().__init__(config)
|
| 460 |
+
self.padding_idx = config.pad_token_id
|
| 461 |
+
self.vocab_size = config.vocab_size
|
| 462 |
+
|
| 463 |
+
self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.padding_idx)
|
| 464 |
+
self.layers = nn.ModuleList(
|
| 465 |
+
[YoutuDecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
|
| 466 |
+
)
|
| 467 |
+
self.norm = YoutuRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
| 468 |
+
self.rotary_emb = YoutuRotaryEmbedding(config=config)
|
| 469 |
+
self.gradient_checkpointing = False
|
| 470 |
+
|
| 471 |
+
# Initialize weights and apply final processing
|
| 472 |
+
self.post_init()
|
| 473 |
+
|
| 474 |
+
@check_model_inputs
|
| 475 |
+
@auto_docstring
|
| 476 |
+
def forward(
|
| 477 |
+
self,
|
| 478 |
+
input_ids: Optional[torch.LongTensor] = None,
|
| 479 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 480 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 481 |
+
past_key_values: Optional[Cache] = None,
|
| 482 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
| 483 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 484 |
+
use_cache: Optional[bool] = None,
|
| 485 |
+
**kwargs: Unpack[TransformersKwargs],
|
| 486 |
+
) -> BaseModelOutputWithPast:
|
| 487 |
+
if (input_ids is None) ^ (inputs_embeds is not None):
|
| 488 |
+
raise ValueError("You must specify exactly one of input_ids or inputs_embeds")
|
| 489 |
+
|
| 490 |
+
if inputs_embeds is None:
|
| 491 |
+
inputs_embeds: torch.Tensor = self.embed_tokens(input_ids)
|
| 492 |
+
|
| 493 |
+
if use_cache and past_key_values is None:
|
| 494 |
+
past_key_values = DynamicCache(config=self.config)
|
| 495 |
+
|
| 496 |
+
if cache_position is None:
|
| 497 |
+
past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0
|
| 498 |
+
cache_position: torch.Tensor = torch.arange(
|
| 499 |
+
past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
|
| 500 |
+
)
|
| 501 |
+
|
| 502 |
+
if position_ids is None:
|
| 503 |
+
position_ids = cache_position.unsqueeze(0)
|
| 504 |
+
|
| 505 |
+
causal_mask = create_causal_mask(
|
| 506 |
+
config=self.config,
|
| 507 |
+
input_embeds=inputs_embeds,
|
| 508 |
+
attention_mask=attention_mask,
|
| 509 |
+
cache_position=cache_position,
|
| 510 |
+
past_key_values=past_key_values,
|
| 511 |
+
position_ids=position_ids,
|
| 512 |
+
)
|
| 513 |
+
|
| 514 |
+
hidden_states = inputs_embeds
|
| 515 |
+
position_embeddings = self.rotary_emb(hidden_states, position_ids)
|
| 516 |
+
|
| 517 |
+
for decoder_layer in self.layers[: self.config.num_hidden_layers]:
|
| 518 |
+
hidden_states = decoder_layer(
|
| 519 |
+
hidden_states,
|
| 520 |
+
attention_mask=causal_mask,
|
| 521 |
+
position_ids=position_ids,
|
| 522 |
+
past_key_values=past_key_values,
|
| 523 |
+
cache_position=cache_position,
|
| 524 |
+
position_embeddings=position_embeddings,
|
| 525 |
+
**kwargs,
|
| 526 |
+
)
|
| 527 |
+
|
| 528 |
+
hidden_states = self.norm(hidden_states)
|
| 529 |
+
return BaseModelOutputWithPast(
|
| 530 |
+
last_hidden_state=hidden_states,
|
| 531 |
+
past_key_values=past_key_values,
|
| 532 |
+
)
|
| 533 |
+
|
| 534 |
+
|
| 535 |
+
@auto_docstring
|
| 536 |
+
class YoutuForCausalLM(YoutuPreTrainedModel, GenerationMixin):
|
| 537 |
+
_tied_weights_keys = ["lm_head.weight"]
|
| 538 |
+
_tp_plan = {"lm_head": "colwise_rep"}
|
| 539 |
+
_pp_plan = {"lm_head": (["hidden_states"], ["logits"])}
|
| 540 |
+
|
| 541 |
+
def __init__(self, config):
|
| 542 |
+
super().__init__(config)
|
| 543 |
+
self.model = YoutuModel(config)
|
| 544 |
+
self.vocab_size = config.vocab_size
|
| 545 |
+
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
| 546 |
+
|
| 547 |
+
# Initialize weights and apply final processing
|
| 548 |
+
self.post_init()
|
| 549 |
+
|
| 550 |
+
@can_return_tuple
|
| 551 |
+
@auto_docstring
|
| 552 |
+
def forward(
|
| 553 |
+
self,
|
| 554 |
+
input_ids: Optional[torch.LongTensor] = None,
|
| 555 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 556 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 557 |
+
past_key_values: Optional[Cache] = None,
|
| 558 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
| 559 |
+
labels: Optional[torch.LongTensor] = None,
|
| 560 |
+
use_cache: Optional[bool] = None,
|
| 561 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 562 |
+
logits_to_keep: Union[int, torch.Tensor] = 0,
|
| 563 |
+
**kwargs: Unpack[TransformersKwargs],
|
| 564 |
+
) -> CausalLMOutputWithPast:
|
| 565 |
+
r"""
|
| 566 |
+
Example:
|
| 567 |
+
|
| 568 |
+
```python
|
| 569 |
+
>>> from transformers import YoutuTokenizer, YoutuForCausalLM
|
| 570 |
+
|
| 571 |
+
>>> model = YoutuForCausalLM.from_pretrained("tencent/Youtu-LLM-2B")
|
| 572 |
+
>>> tokenizer = YoutuTokenizer.from_pretrained("tencent/Youtu-LLM-2B")
|
| 573 |
+
|
| 574 |
+
>>> prompt = "Hey, are you conscious? Can you talk to me?"
|
| 575 |
+
>>> inputs = tokenizer(prompt, return_tensors="pt")
|
| 576 |
+
|
| 577 |
+
>>> # Generate
|
| 578 |
+
>>> generate_ids = model.generate(inputs.input_ids, max_length=30)
|
| 579 |
+
>>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
| 580 |
+
```"""
|
| 581 |
+
outputs: BaseModelOutputWithPast = self.model(
|
| 582 |
+
input_ids=input_ids,
|
| 583 |
+
attention_mask=attention_mask,
|
| 584 |
+
position_ids=position_ids,
|
| 585 |
+
past_key_values=past_key_values,
|
| 586 |
+
inputs_embeds=inputs_embeds,
|
| 587 |
+
use_cache=use_cache,
|
| 588 |
+
cache_position=cache_position,
|
| 589 |
+
**kwargs,
|
| 590 |
+
)
|
| 591 |
+
|
| 592 |
+
hidden_states = outputs.last_hidden_state
|
| 593 |
+
# Only compute necessary logits, and do not upcast them to float if we are not computing the loss
|
| 594 |
+
slice_indices = slice(-logits_to_keep, None) if isinstance(logits_to_keep, int) else logits_to_keep
|
| 595 |
+
logits = self.lm_head(hidden_states[:, slice_indices, :])
|
| 596 |
+
|
| 597 |
+
loss = None
|
| 598 |
+
if labels is not None:
|
| 599 |
+
loss = self.loss_function(logits=logits, labels=labels, vocab_size=self.config.vocab_size, **kwargs)
|
| 600 |
+
|
| 601 |
+
return CausalLMOutputWithPast(
|
| 602 |
+
loss=loss,
|
| 603 |
+
logits=logits,
|
| 604 |
+
past_key_values=outputs.past_key_values,
|
| 605 |
+
hidden_states=outputs.hidden_states,
|
| 606 |
+
attentions=outputs.attentions,
|
| 607 |
+
)
|
| 608 |
+
|
| 609 |
+
|
| 610 |
+
__all__ = ["YoutuPreTrainedModel", "YoutuModel", "YoutuForCausalLM"]
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"additional_special_tokens": null,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|begin_of_text|>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|end_of_text|>",
|
| 7 |
+
"is_local": true,
|
| 8 |
+
"model_input_names": [
|
| 9 |
+
"input_ids",
|
| 10 |
+
"attention_mask"
|
| 11 |
+
],
|
| 12 |
+
"model_max_length": 131072,
|
| 13 |
+
"model_specific_special_tokens": {},
|
| 14 |
+
"pad_token": "<|end_of_text|>",
|
| 15 |
+
"tokenizer_class": "TokenizersBackend",
|
| 16 |
+
"truncation_side": "left"
|
| 17 |
+
}
|