Text Generation
MLX
Safetensors
enggpt_moe
mlx-lm
conversational
mixture-of-experts
Mixture of Experts
enggpt
apple-silicon
custom_code
quantized
4bit
4-bit precision
Instructions to use robertobissanti/EngGPT2-16B-A3B-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use robertobissanti/EngGPT2-16B-A3B-MLX-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("robertobissanti/EngGPT2-16B-A3B-MLX-4bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use robertobissanti/EngGPT2-16B-A3B-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "robertobissanti/EngGPT2-16B-A3B-MLX-4bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "robertobissanti/EngGPT2-16B-A3B-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use robertobissanti/EngGPT2-16B-A3B-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "robertobissanti/EngGPT2-16B-A3B-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "robertobissanti/EngGPT2-16B-A3B-MLX-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "robertobissanti/EngGPT2-16B-A3B-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use robertobissanti/EngGPT2-16B-A3B-MLX-4bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "robertobissanti/EngGPT2-16B-A3B-MLX-4bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default robertobissanti/EngGPT2-16B-A3B-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use robertobissanti/EngGPT2-16B-A3B-MLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "robertobissanti/EngGPT2-16B-A3B-MLX-4bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "robertobissanti/EngGPT2-16B-A3B-MLX-4bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Add files using upload-large-folder tool
Browse files- .gitattributes +1 -0
- README.md +7 -0
- chat_template.jinja +124 -0
- config.json +56 -0
- configuration_enggpt_moe.py +98 -0
- generation_config.json +7 -0
- model-00001-of-00003.safetensors +3 -0
- model-00002-of-00003.safetensors +3 -0
- model-00003-of-00003.safetensors +3 -0
- model.safetensors.index.json +639 -0
- modeling_enggpt_moe.py +688 -0
- tokenizer.json +3 -0
- tokenizer_config.json +13 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
library_name: mlx
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- mlx
|
| 7 |
+
---
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools or xml_tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0].role == 'system' %}
|
| 4 |
+
{{- messages[0].content + '\n\n' }}
|
| 5 |
+
{%- endif %}
|
| 6 |
+
{%- if custom_instructions %}
|
| 7 |
+
{{- custom_instructions ~ '\n\n' }}
|
| 8 |
+
{%- endif -%}
|
| 9 |
+
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 10 |
+
{%- for tool in (xml_tools or tools) %}
|
| 11 |
+
{{- "\n" }}
|
| 12 |
+
{{- tool }}
|
| 13 |
+
{%- endfor %}
|
| 14 |
+
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call>" }}
|
| 15 |
+
{%- if python_tools -%}
|
| 16 |
+
{{- python_tools -}}
|
| 17 |
+
{%- endif -%}
|
| 18 |
+
{{- "<|im_end|>\n" }}
|
| 19 |
+
{%- else %}
|
| 20 |
+
{%- if messages[0].role == 'system' %}
|
| 21 |
+
{{- '<|im_start|>system\n' + messages[0].content }}
|
| 22 |
+
{%- if custom_instructions %}
|
| 23 |
+
{{- custom_instructions -}}
|
| 24 |
+
{%- endif -%}
|
| 25 |
+
{{- '<|im_end|>\n' }}
|
| 26 |
+
{%- elif custom_instructions -%}
|
| 27 |
+
{{- '<|im_start|>system\n' ~ custom_instructions ~ '<|im_end|>\n' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{%- endif %}
|
| 30 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 31 |
+
{%- for message in messages[::-1] %}
|
| 32 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 33 |
+
{%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 34 |
+
{%- set ns.multi_step_tool = false %}
|
| 35 |
+
{%- set ns.last_query_index = index %}
|
| 36 |
+
{%- endif %}
|
| 37 |
+
{%- endfor %}
|
| 38 |
+
{%- for message in messages %}
|
| 39 |
+
{%- if message.content is string %}
|
| 40 |
+
{%- set content = message.content %}
|
| 41 |
+
{%- else %}
|
| 42 |
+
{%- set content = '' %}
|
| 43 |
+
{%- endif %}
|
| 44 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 45 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 46 |
+
{%- elif message.role == "assistant" %}
|
| 47 |
+
{%- set reasoning_content = '' %}
|
| 48 |
+
{%- if message.reasoning_content is string %}
|
| 49 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 50 |
+
{%- else %}
|
| 51 |
+
{%- if '</think>' in content %}
|
| 52 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 53 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 54 |
+
{%- endif %}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
{{- '<|im_start|>' + message.role + '\n' }}
|
| 57 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 58 |
+
{%- if (not loop.last and reasoning_content) %}
|
| 59 |
+
{{- '/reasoning_' ~ (reasoning_lang | default('en', true)) ~ '\n' }}
|
| 60 |
+
{%- if enable_turbo %}
|
| 61 |
+
{{- '/turbo\n' }}
|
| 62 |
+
{%- endif %}
|
| 63 |
+
{% generation %}
|
| 64 |
+
{{- '<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') -}}
|
| 65 |
+
{% endgeneration %}
|
| 66 |
+
{%- elif loop.last %}
|
| 67 |
+
{%- if reasoning_content %}
|
| 68 |
+
{{- '/reasoning_' ~ (reasoning_lang | default('en', true)) ~ '\n' }}
|
| 69 |
+
{%- if enable_turbo %}
|
| 70 |
+
{{- '/turbo\n' }}
|
| 71 |
+
{%- endif %}
|
| 72 |
+
{% generation %}
|
| 73 |
+
{{- '<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') -}}
|
| 74 |
+
{% endgeneration %}
|
| 75 |
+
{%- else %}
|
| 76 |
+
{{- '<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' }}
|
| 77 |
+
{% generation %}
|
| 78 |
+
{{- content.lstrip('\n') -}}
|
| 79 |
+
{% endgeneration %}
|
| 80 |
+
{%- endif %}
|
| 81 |
+
{%- else %}
|
| 82 |
+
{% generation %}
|
| 83 |
+
{{- content -}}
|
| 84 |
+
{% endgeneration %}
|
| 85 |
+
{%- endif %}
|
| 86 |
+
{%- else %}
|
| 87 |
+
{% generation %}
|
| 88 |
+
{{- content -}}
|
| 89 |
+
{% endgeneration %}
|
| 90 |
+
{%- endif %}
|
| 91 |
+
{% generation %}
|
| 92 |
+
{%- if message.tool_calls %}
|
| 93 |
+
{%- for tool_call in message.tool_calls %}
|
| 94 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 95 |
+
{{- '\n' }}
|
| 96 |
+
{%- endif %}
|
| 97 |
+
{{- '<tool_call>\n' ~ tool_call ~ '\n</tool_call>' }}
|
| 98 |
+
{%- endfor %}
|
| 99 |
+
{%- endif %}
|
| 100 |
+
{{- '<|im_end|>' }}
|
| 101 |
+
{% endgeneration %}
|
| 102 |
+
{%- elif message.role == "tool" %}
|
| 103 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 104 |
+
{{- '<|im_start|>user' }}
|
| 105 |
+
{%- endif %}
|
| 106 |
+
{{- '\n<tool_response>\n' }}
|
| 107 |
+
{{- content }}
|
| 108 |
+
{{- '\n</tool_response>' }}
|
| 109 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 110 |
+
{{- '<|im_end|>\n' }}
|
| 111 |
+
{%- endif %}
|
| 112 |
+
{%- endif %}
|
| 113 |
+
{%- endfor %}
|
| 114 |
+
{%- if add_generation_prompt %}
|
| 115 |
+
{{- '<|im_start|>assistant\n' }}
|
| 116 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 117 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 118 |
+
{%- else %}
|
| 119 |
+
{{- '/reasoning_' ~ (reasoning_lang | default('en', true)) ~ '\n' }}
|
| 120 |
+
{%- if enable_turbo %}
|
| 121 |
+
{{- '/turbo\n' }}
|
| 122 |
+
{%- endif %}
|
| 123 |
+
{%- endif %}
|
| 124 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"EngGPTMoeForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_enggpt_moe.EngGPTMoeConfig",
|
| 9 |
+
"AutoModelForCausalLM": "modeling_enggpt_moe.EngGPTMoeForCausalLM"
|
| 10 |
+
},
|
| 11 |
+
"bos_token_id": 1,
|
| 12 |
+
"decoder_sparse_step": 1,
|
| 13 |
+
"dtype": "bfloat16",
|
| 14 |
+
"eos_token_id": 131073,
|
| 15 |
+
"head_dim": 128,
|
| 16 |
+
"hidden_act": "silu",
|
| 17 |
+
"hidden_size": 2880,
|
| 18 |
+
"initializer_range": 0.02,
|
| 19 |
+
"intermediate_size": 8640,
|
| 20 |
+
"max_position_embeddings": 40960,
|
| 21 |
+
"max_window_layers": 24,
|
| 22 |
+
"mlp_only_layers": [],
|
| 23 |
+
"model_type": "enggpt_moe",
|
| 24 |
+
"moe_intermediate_size": 1080,
|
| 25 |
+
"norm_topk_prob": true,
|
| 26 |
+
"num_attention_heads": 32,
|
| 27 |
+
"num_experts": 64,
|
| 28 |
+
"num_experts_per_tok": 8,
|
| 29 |
+
"num_hidden_layers": 24,
|
| 30 |
+
"num_key_value_heads": 4,
|
| 31 |
+
"out_proj_bias": null,
|
| 32 |
+
"output_router_logits": false,
|
| 33 |
+
"pad_token_id": 131083,
|
| 34 |
+
"qkv_proj_bias": null,
|
| 35 |
+
"quantization": {
|
| 36 |
+
"group_size": 64,
|
| 37 |
+
"bits": 4,
|
| 38 |
+
"mode": "affine"
|
| 39 |
+
},
|
| 40 |
+
"quantization_config": {
|
| 41 |
+
"group_size": 64,
|
| 42 |
+
"bits": 4,
|
| 43 |
+
"mode": "affine"
|
| 44 |
+
},
|
| 45 |
+
"rms_norm_eps": 1e-06,
|
| 46 |
+
"rope_scaling": null,
|
| 47 |
+
"rope_theta": 1000000.0,
|
| 48 |
+
"router_aux_loss_coef": 0.001,
|
| 49 |
+
"sliding_window": null,
|
| 50 |
+
"tie_word_embeddings": false,
|
| 51 |
+
"transformers_version": "4.57.0",
|
| 52 |
+
"use_bias": false,
|
| 53 |
+
"use_cache": false,
|
| 54 |
+
"use_sliding_window": false,
|
| 55 |
+
"vocab_size": 131084
|
| 56 |
+
}
|
configuration_enggpt_moe.py
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""EngGPT model configuration"""
|
| 2 |
+
|
| 3 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 4 |
+
from transformers.modeling_rope_utils import rope_config_validation
|
| 5 |
+
|
| 6 |
+
class EngGPTMoeConfig(PretrainedConfig):
|
| 7 |
+
|
| 8 |
+
model_type = "enggpt_moe"
|
| 9 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
| 10 |
+
|
| 11 |
+
base_model_tp_plan = {
|
| 12 |
+
"layers.*.self_attn.q_proj": "colwise",
|
| 13 |
+
"layers.*.self_attn.k_proj": "colwise",
|
| 14 |
+
"layers.*.self_attn.v_proj": "colwise",
|
| 15 |
+
"layers.*.self_attn.o_proj": "rowwise",
|
| 16 |
+
"layers.*.mlp.experts.*.gate_proj": "colwise",
|
| 17 |
+
"layers.*.mlp.experts.*.up_proj": "colwise",
|
| 18 |
+
"layers.*.mlp.experts.*.down_proj": "rowwise",
|
| 19 |
+
"layers.*.mlp.gate_proj": "colwise",
|
| 20 |
+
"layers.*.mlp.up_proj": "colwise",
|
| 21 |
+
"layers.*.mlp.down_proj": "rowwise",
|
| 22 |
+
}
|
| 23 |
+
base_model_pp_plan = {
|
| 24 |
+
"embed_tokens": (["input_ids"], ["inputs_embeds"]),
|
| 25 |
+
"layers": (["hidden_states", "attention_mask"], ["hidden_states"]),
|
| 26 |
+
"norm": (["hidden_states"], ["hidden_states"]),
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
def __init__(
|
| 30 |
+
self,
|
| 31 |
+
vocab_size=131084,
|
| 32 |
+
hidden_size=2880,
|
| 33 |
+
intermediate_size=8640,
|
| 34 |
+
num_hidden_layers=24,
|
| 35 |
+
num_attention_heads=32,
|
| 36 |
+
num_key_value_heads=4,
|
| 37 |
+
hidden_act="silu",
|
| 38 |
+
max_position_embeddings=32768,
|
| 39 |
+
initializer_range=0.02,
|
| 40 |
+
rms_norm_eps=1e-6,
|
| 41 |
+
use_cache=False,
|
| 42 |
+
tie_word_embeddings=False,
|
| 43 |
+
rope_theta=1000000.0,
|
| 44 |
+
rope_scaling=None,
|
| 45 |
+
attention_bias=False,
|
| 46 |
+
use_sliding_window=False,
|
| 47 |
+
sliding_window=None,
|
| 48 |
+
attention_dropout=0.0,
|
| 49 |
+
decoder_sparse_step=1,
|
| 50 |
+
moe_intermediate_size=1080,
|
| 51 |
+
num_experts_per_tok=8,
|
| 52 |
+
num_experts=64,
|
| 53 |
+
norm_topk_prob=True,
|
| 54 |
+
output_router_logits=False,
|
| 55 |
+
router_aux_loss_coef=0.001,
|
| 56 |
+
mlp_only_layers=None,
|
| 57 |
+
**kwargs,
|
| 58 |
+
):
|
| 59 |
+
self.vocab_size = vocab_size
|
| 60 |
+
self.max_position_embeddings = max_position_embeddings
|
| 61 |
+
self.hidden_size = hidden_size
|
| 62 |
+
self.intermediate_size = intermediate_size
|
| 63 |
+
self.num_hidden_layers = num_hidden_layers
|
| 64 |
+
self.num_attention_heads = num_attention_heads
|
| 65 |
+
self.use_sliding_window = use_sliding_window
|
| 66 |
+
self.sliding_window = sliding_window if use_sliding_window else None
|
| 67 |
+
|
| 68 |
+
self.num_key_value_heads = num_key_value_heads
|
| 69 |
+
self.hidden_act = hidden_act
|
| 70 |
+
self.initializer_range = initializer_range
|
| 71 |
+
self.rms_norm_eps = rms_norm_eps
|
| 72 |
+
self.use_cache = use_cache
|
| 73 |
+
self.rope_theta = rope_theta
|
| 74 |
+
self.rope_scaling = rope_scaling
|
| 75 |
+
self.attention_bias = attention_bias
|
| 76 |
+
self.attention_dropout = attention_dropout
|
| 77 |
+
|
| 78 |
+
if self.rope_scaling is not None and "type" in self.rope_scaling:
|
| 79 |
+
self.rope_scaling["rope_type"] = self.rope_scaling["type"]
|
| 80 |
+
rope_config_validation(self)
|
| 81 |
+
|
| 82 |
+
# MoE arguments
|
| 83 |
+
self.decoder_sparse_step = decoder_sparse_step
|
| 84 |
+
self.moe_intermediate_size = moe_intermediate_size
|
| 85 |
+
self.num_experts_per_tok = num_experts_per_tok
|
| 86 |
+
self.num_experts = num_experts
|
| 87 |
+
self.norm_topk_prob = norm_topk_prob
|
| 88 |
+
self.output_router_logits = output_router_logits
|
| 89 |
+
self.router_aux_loss_coef = router_aux_loss_coef
|
| 90 |
+
self.mlp_only_layers = [] if mlp_only_layers is None else mlp_only_layers
|
| 91 |
+
|
| 92 |
+
super().__init__(
|
| 93 |
+
tie_word_embeddings=tie_word_embeddings,
|
| 94 |
+
**kwargs,
|
| 95 |
+
)
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
__all__ = ["EngGPTMoeConfig"]
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 131073,
|
| 5 |
+
"pad_token_id": 131083,
|
| 6 |
+
"transformers_version": "4.57.6"
|
| 7 |
+
}
|
model-00001-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db82e121b88af8ef962d46c06b61d01724fe4a8e0d315219a8060baa036893a1
|
| 3 |
+
size 5324421483
|
model-00002-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6b46506c4c36197ce0af1525a6bfae063ba67da9c2754b767a73083fd95a7047
|
| 3 |
+
size 5320978891
|
model-00003-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a3eddd192aa937088a68d93378009be5b93a9a0c3a6803407bc454238282c5ea
|
| 3 |
+
size 5070405996
|
model.safetensors.index.json
ADDED
|
@@ -0,0 +1,639 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"metadata": {
|
| 3 |
+
"total_size": 15715733088,
|
| 4 |
+
"total_parameters": 15729347904
|
| 5 |
+
},
|
| 6 |
+
"weight_map": {
|
| 7 |
+
"lm_head.biases": "model-00003-of-00003.safetensors",
|
| 8 |
+
"lm_head.scales": "model-00003-of-00003.safetensors",
|
| 9 |
+
"lm_head.weight": "model-00003-of-00003.safetensors",
|
| 10 |
+
"model.embed_tokens.biases": "model-00001-of-00003.safetensors",
|
| 11 |
+
"model.embed_tokens.scales": "model-00001-of-00003.safetensors",
|
| 12 |
+
"model.embed_tokens.weight": "model-00001-of-00003.safetensors",
|
| 13 |
+
"model.layers.0.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 14 |
+
"model.layers.0.mlp.gate.biases": "model-00001-of-00003.safetensors",
|
| 15 |
+
"model.layers.0.mlp.gate.scales": "model-00001-of-00003.safetensors",
|
| 16 |
+
"model.layers.0.mlp.gate.weight": "model-00001-of-00003.safetensors",
|
| 17 |
+
"model.layers.0.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
|
| 18 |
+
"model.layers.0.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
|
| 19 |
+
"model.layers.0.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
|
| 20 |
+
"model.layers.0.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
|
| 21 |
+
"model.layers.0.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
|
| 22 |
+
"model.layers.0.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
|
| 23 |
+
"model.layers.0.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
|
| 24 |
+
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 25 |
+
"model.layers.0.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
|
| 26 |
+
"model.layers.0.self_attn.k_proj.biases": "model-00001-of-00003.safetensors",
|
| 27 |
+
"model.layers.0.self_attn.k_proj.scales": "model-00001-of-00003.safetensors",
|
| 28 |
+
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
|
| 29 |
+
"model.layers.0.self_attn.o_proj.biases": "model-00001-of-00003.safetensors",
|
| 30 |
+
"model.layers.0.self_attn.o_proj.scales": "model-00001-of-00003.safetensors",
|
| 31 |
+
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
|
| 32 |
+
"model.layers.0.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
|
| 33 |
+
"model.layers.0.self_attn.q_proj.biases": "model-00001-of-00003.safetensors",
|
| 34 |
+
"model.layers.0.self_attn.q_proj.scales": "model-00001-of-00003.safetensors",
|
| 35 |
+
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
|
| 36 |
+
"model.layers.0.self_attn.v_proj.biases": "model-00001-of-00003.safetensors",
|
| 37 |
+
"model.layers.0.self_attn.v_proj.scales": "model-00001-of-00003.safetensors",
|
| 38 |
+
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
|
| 39 |
+
"model.layers.1.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 40 |
+
"model.layers.1.mlp.gate.biases": "model-00001-of-00003.safetensors",
|
| 41 |
+
"model.layers.1.mlp.gate.scales": "model-00001-of-00003.safetensors",
|
| 42 |
+
"model.layers.1.mlp.gate.weight": "model-00001-of-00003.safetensors",
|
| 43 |
+
"model.layers.1.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
|
| 44 |
+
"model.layers.1.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
|
| 45 |
+
"model.layers.1.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
|
| 46 |
+
"model.layers.1.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
|
| 47 |
+
"model.layers.1.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
|
| 48 |
+
"model.layers.1.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
|
| 49 |
+
"model.layers.1.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
|
| 50 |
+
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 51 |
+
"model.layers.1.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
|
| 52 |
+
"model.layers.1.self_attn.k_proj.biases": "model-00001-of-00003.safetensors",
|
| 53 |
+
"model.layers.1.self_attn.k_proj.scales": "model-00001-of-00003.safetensors",
|
| 54 |
+
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
|
| 55 |
+
"model.layers.1.self_attn.o_proj.biases": "model-00001-of-00003.safetensors",
|
| 56 |
+
"model.layers.1.self_attn.o_proj.scales": "model-00001-of-00003.safetensors",
|
| 57 |
+
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
|
| 58 |
+
"model.layers.1.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
|
| 59 |
+
"model.layers.1.self_attn.q_proj.biases": "model-00001-of-00003.safetensors",
|
| 60 |
+
"model.layers.1.self_attn.q_proj.scales": "model-00001-of-00003.safetensors",
|
| 61 |
+
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
|
| 62 |
+
"model.layers.1.self_attn.v_proj.biases": "model-00001-of-00003.safetensors",
|
| 63 |
+
"model.layers.1.self_attn.v_proj.scales": "model-00001-of-00003.safetensors",
|
| 64 |
+
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
|
| 65 |
+
"model.layers.10.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 66 |
+
"model.layers.10.mlp.gate.biases": "model-00002-of-00003.safetensors",
|
| 67 |
+
"model.layers.10.mlp.gate.scales": "model-00002-of-00003.safetensors",
|
| 68 |
+
"model.layers.10.mlp.gate.weight": "model-00002-of-00003.safetensors",
|
| 69 |
+
"model.layers.10.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
|
| 70 |
+
"model.layers.10.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
|
| 71 |
+
"model.layers.10.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
|
| 72 |
+
"model.layers.10.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
|
| 73 |
+
"model.layers.10.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
|
| 74 |
+
"model.layers.10.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
|
| 75 |
+
"model.layers.10.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
|
| 76 |
+
"model.layers.10.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 77 |
+
"model.layers.10.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
|
| 78 |
+
"model.layers.10.self_attn.k_proj.biases": "model-00002-of-00003.safetensors",
|
| 79 |
+
"model.layers.10.self_attn.k_proj.scales": "model-00002-of-00003.safetensors",
|
| 80 |
+
"model.layers.10.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
|
| 81 |
+
"model.layers.10.self_attn.o_proj.biases": "model-00002-of-00003.safetensors",
|
| 82 |
+
"model.layers.10.self_attn.o_proj.scales": "model-00002-of-00003.safetensors",
|
| 83 |
+
"model.layers.10.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
|
| 84 |
+
"model.layers.10.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
|
| 85 |
+
"model.layers.10.self_attn.q_proj.biases": "model-00002-of-00003.safetensors",
|
| 86 |
+
"model.layers.10.self_attn.q_proj.scales": "model-00002-of-00003.safetensors",
|
| 87 |
+
"model.layers.10.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
|
| 88 |
+
"model.layers.10.self_attn.v_proj.biases": "model-00002-of-00003.safetensors",
|
| 89 |
+
"model.layers.10.self_attn.v_proj.scales": "model-00002-of-00003.safetensors",
|
| 90 |
+
"model.layers.10.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
|
| 91 |
+
"model.layers.11.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 92 |
+
"model.layers.11.mlp.gate.biases": "model-00002-of-00003.safetensors",
|
| 93 |
+
"model.layers.11.mlp.gate.scales": "model-00002-of-00003.safetensors",
|
| 94 |
+
"model.layers.11.mlp.gate.weight": "model-00002-of-00003.safetensors",
|
| 95 |
+
"model.layers.11.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
|
| 96 |
+
"model.layers.11.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
|
| 97 |
+
"model.layers.11.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
|
| 98 |
+
"model.layers.11.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
|
| 99 |
+
"model.layers.11.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
|
| 100 |
+
"model.layers.11.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
|
| 101 |
+
"model.layers.11.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
|
| 102 |
+
"model.layers.11.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 103 |
+
"model.layers.11.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
|
| 104 |
+
"model.layers.11.self_attn.k_proj.biases": "model-00002-of-00003.safetensors",
|
| 105 |
+
"model.layers.11.self_attn.k_proj.scales": "model-00002-of-00003.safetensors",
|
| 106 |
+
"model.layers.11.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
|
| 107 |
+
"model.layers.11.self_attn.o_proj.biases": "model-00002-of-00003.safetensors",
|
| 108 |
+
"model.layers.11.self_attn.o_proj.scales": "model-00002-of-00003.safetensors",
|
| 109 |
+
"model.layers.11.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
|
| 110 |
+
"model.layers.11.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
|
| 111 |
+
"model.layers.11.self_attn.q_proj.biases": "model-00002-of-00003.safetensors",
|
| 112 |
+
"model.layers.11.self_attn.q_proj.scales": "model-00002-of-00003.safetensors",
|
| 113 |
+
"model.layers.11.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
|
| 114 |
+
"model.layers.11.self_attn.v_proj.biases": "model-00002-of-00003.safetensors",
|
| 115 |
+
"model.layers.11.self_attn.v_proj.scales": "model-00002-of-00003.safetensors",
|
| 116 |
+
"model.layers.11.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
|
| 117 |
+
"model.layers.12.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 118 |
+
"model.layers.12.mlp.gate.biases": "model-00002-of-00003.safetensors",
|
| 119 |
+
"model.layers.12.mlp.gate.scales": "model-00002-of-00003.safetensors",
|
| 120 |
+
"model.layers.12.mlp.gate.weight": "model-00002-of-00003.safetensors",
|
| 121 |
+
"model.layers.12.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
|
| 122 |
+
"model.layers.12.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
|
| 123 |
+
"model.layers.12.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
|
| 124 |
+
"model.layers.12.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
|
| 125 |
+
"model.layers.12.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
|
| 126 |
+
"model.layers.12.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
|
| 127 |
+
"model.layers.12.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
|
| 128 |
+
"model.layers.12.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 129 |
+
"model.layers.12.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
|
| 130 |
+
"model.layers.12.self_attn.k_proj.biases": "model-00002-of-00003.safetensors",
|
| 131 |
+
"model.layers.12.self_attn.k_proj.scales": "model-00002-of-00003.safetensors",
|
| 132 |
+
"model.layers.12.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
|
| 133 |
+
"model.layers.12.self_attn.o_proj.biases": "model-00002-of-00003.safetensors",
|
| 134 |
+
"model.layers.12.self_attn.o_proj.scales": "model-00002-of-00003.safetensors",
|
| 135 |
+
"model.layers.12.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
|
| 136 |
+
"model.layers.12.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
|
| 137 |
+
"model.layers.12.self_attn.q_proj.biases": "model-00002-of-00003.safetensors",
|
| 138 |
+
"model.layers.12.self_attn.q_proj.scales": "model-00002-of-00003.safetensors",
|
| 139 |
+
"model.layers.12.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
|
| 140 |
+
"model.layers.12.self_attn.v_proj.biases": "model-00002-of-00003.safetensors",
|
| 141 |
+
"model.layers.12.self_attn.v_proj.scales": "model-00002-of-00003.safetensors",
|
| 142 |
+
"model.layers.12.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
|
| 143 |
+
"model.layers.13.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 144 |
+
"model.layers.13.mlp.gate.biases": "model-00002-of-00003.safetensors",
|
| 145 |
+
"model.layers.13.mlp.gate.scales": "model-00002-of-00003.safetensors",
|
| 146 |
+
"model.layers.13.mlp.gate.weight": "model-00002-of-00003.safetensors",
|
| 147 |
+
"model.layers.13.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
|
| 148 |
+
"model.layers.13.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
|
| 149 |
+
"model.layers.13.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
|
| 150 |
+
"model.layers.13.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
|
| 151 |
+
"model.layers.13.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
|
| 152 |
+
"model.layers.13.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
|
| 153 |
+
"model.layers.13.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
|
| 154 |
+
"model.layers.13.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 155 |
+
"model.layers.13.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
|
| 156 |
+
"model.layers.13.self_attn.k_proj.biases": "model-00002-of-00003.safetensors",
|
| 157 |
+
"model.layers.13.self_attn.k_proj.scales": "model-00002-of-00003.safetensors",
|
| 158 |
+
"model.layers.13.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
|
| 159 |
+
"model.layers.13.self_attn.o_proj.biases": "model-00002-of-00003.safetensors",
|
| 160 |
+
"model.layers.13.self_attn.o_proj.scales": "model-00002-of-00003.safetensors",
|
| 161 |
+
"model.layers.13.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
|
| 162 |
+
"model.layers.13.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
|
| 163 |
+
"model.layers.13.self_attn.q_proj.biases": "model-00002-of-00003.safetensors",
|
| 164 |
+
"model.layers.13.self_attn.q_proj.scales": "model-00002-of-00003.safetensors",
|
| 165 |
+
"model.layers.13.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
|
| 166 |
+
"model.layers.13.self_attn.v_proj.biases": "model-00002-of-00003.safetensors",
|
| 167 |
+
"model.layers.13.self_attn.v_proj.scales": "model-00002-of-00003.safetensors",
|
| 168 |
+
"model.layers.13.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
|
| 169 |
+
"model.layers.14.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 170 |
+
"model.layers.14.mlp.gate.biases": "model-00002-of-00003.safetensors",
|
| 171 |
+
"model.layers.14.mlp.gate.scales": "model-00002-of-00003.safetensors",
|
| 172 |
+
"model.layers.14.mlp.gate.weight": "model-00002-of-00003.safetensors",
|
| 173 |
+
"model.layers.14.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
|
| 174 |
+
"model.layers.14.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
|
| 175 |
+
"model.layers.14.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
|
| 176 |
+
"model.layers.14.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
|
| 177 |
+
"model.layers.14.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
|
| 178 |
+
"model.layers.14.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
|
| 179 |
+
"model.layers.14.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
|
| 180 |
+
"model.layers.14.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 181 |
+
"model.layers.14.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
|
| 182 |
+
"model.layers.14.self_attn.k_proj.biases": "model-00002-of-00003.safetensors",
|
| 183 |
+
"model.layers.14.self_attn.k_proj.scales": "model-00002-of-00003.safetensors",
|
| 184 |
+
"model.layers.14.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
|
| 185 |
+
"model.layers.14.self_attn.o_proj.biases": "model-00002-of-00003.safetensors",
|
| 186 |
+
"model.layers.14.self_attn.o_proj.scales": "model-00002-of-00003.safetensors",
|
| 187 |
+
"model.layers.14.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
|
| 188 |
+
"model.layers.14.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
|
| 189 |
+
"model.layers.14.self_attn.q_proj.biases": "model-00002-of-00003.safetensors",
|
| 190 |
+
"model.layers.14.self_attn.q_proj.scales": "model-00002-of-00003.safetensors",
|
| 191 |
+
"model.layers.14.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
|
| 192 |
+
"model.layers.14.self_attn.v_proj.biases": "model-00002-of-00003.safetensors",
|
| 193 |
+
"model.layers.14.self_attn.v_proj.scales": "model-00002-of-00003.safetensors",
|
| 194 |
+
"model.layers.14.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
|
| 195 |
+
"model.layers.15.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 196 |
+
"model.layers.15.mlp.gate.biases": "model-00002-of-00003.safetensors",
|
| 197 |
+
"model.layers.15.mlp.gate.scales": "model-00002-of-00003.safetensors",
|
| 198 |
+
"model.layers.15.mlp.gate.weight": "model-00002-of-00003.safetensors",
|
| 199 |
+
"model.layers.15.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
|
| 200 |
+
"model.layers.15.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
|
| 201 |
+
"model.layers.15.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
|
| 202 |
+
"model.layers.15.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
|
| 203 |
+
"model.layers.15.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
|
| 204 |
+
"model.layers.15.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
|
| 205 |
+
"model.layers.15.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
|
| 206 |
+
"model.layers.15.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 207 |
+
"model.layers.15.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
|
| 208 |
+
"model.layers.15.self_attn.k_proj.biases": "model-00002-of-00003.safetensors",
|
| 209 |
+
"model.layers.15.self_attn.k_proj.scales": "model-00002-of-00003.safetensors",
|
| 210 |
+
"model.layers.15.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
|
| 211 |
+
"model.layers.15.self_attn.o_proj.biases": "model-00002-of-00003.safetensors",
|
| 212 |
+
"model.layers.15.self_attn.o_proj.scales": "model-00002-of-00003.safetensors",
|
| 213 |
+
"model.layers.15.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
|
| 214 |
+
"model.layers.15.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
|
| 215 |
+
"model.layers.15.self_attn.q_proj.biases": "model-00002-of-00003.safetensors",
|
| 216 |
+
"model.layers.15.self_attn.q_proj.scales": "model-00002-of-00003.safetensors",
|
| 217 |
+
"model.layers.15.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
|
| 218 |
+
"model.layers.15.self_attn.v_proj.biases": "model-00002-of-00003.safetensors",
|
| 219 |
+
"model.layers.15.self_attn.v_proj.scales": "model-00002-of-00003.safetensors",
|
| 220 |
+
"model.layers.15.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
|
| 221 |
+
"model.layers.16.input_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 222 |
+
"model.layers.16.mlp.gate.biases": "model-00002-of-00003.safetensors",
|
| 223 |
+
"model.layers.16.mlp.gate.scales": "model-00002-of-00003.safetensors",
|
| 224 |
+
"model.layers.16.mlp.gate.weight": "model-00002-of-00003.safetensors",
|
| 225 |
+
"model.layers.16.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
|
| 226 |
+
"model.layers.16.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
|
| 227 |
+
"model.layers.16.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
|
| 228 |
+
"model.layers.16.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
|
| 229 |
+
"model.layers.16.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
|
| 230 |
+
"model.layers.16.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
|
| 231 |
+
"model.layers.16.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
|
| 232 |
+
"model.layers.16.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 233 |
+
"model.layers.16.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
|
| 234 |
+
"model.layers.16.self_attn.k_proj.biases": "model-00002-of-00003.safetensors",
|
| 235 |
+
"model.layers.16.self_attn.k_proj.scales": "model-00002-of-00003.safetensors",
|
| 236 |
+
"model.layers.16.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
|
| 237 |
+
"model.layers.16.self_attn.o_proj.biases": "model-00002-of-00003.safetensors",
|
| 238 |
+
"model.layers.16.self_attn.o_proj.scales": "model-00002-of-00003.safetensors",
|
| 239 |
+
"model.layers.16.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
|
| 240 |
+
"model.layers.16.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
|
| 241 |
+
"model.layers.16.self_attn.q_proj.biases": "model-00002-of-00003.safetensors",
|
| 242 |
+
"model.layers.16.self_attn.q_proj.scales": "model-00002-of-00003.safetensors",
|
| 243 |
+
"model.layers.16.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
|
| 244 |
+
"model.layers.16.self_attn.v_proj.biases": "model-00002-of-00003.safetensors",
|
| 245 |
+
"model.layers.16.self_attn.v_proj.scales": "model-00002-of-00003.safetensors",
|
| 246 |
+
"model.layers.16.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
|
| 247 |
+
"model.layers.17.input_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 248 |
+
"model.layers.17.mlp.gate.biases": "model-00003-of-00003.safetensors",
|
| 249 |
+
"model.layers.17.mlp.gate.scales": "model-00003-of-00003.safetensors",
|
| 250 |
+
"model.layers.17.mlp.gate.weight": "model-00003-of-00003.safetensors",
|
| 251 |
+
"model.layers.17.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
|
| 252 |
+
"model.layers.17.mlp.switch_mlp.gate_proj.biases": "model-00003-of-00003.safetensors",
|
| 253 |
+
"model.layers.17.mlp.switch_mlp.gate_proj.scales": "model-00003-of-00003.safetensors",
|
| 254 |
+
"model.layers.17.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
|
| 255 |
+
"model.layers.17.mlp.switch_mlp.up_proj.biases": "model-00003-of-00003.safetensors",
|
| 256 |
+
"model.layers.17.mlp.switch_mlp.up_proj.scales": "model-00003-of-00003.safetensors",
|
| 257 |
+
"model.layers.17.mlp.switch_mlp.up_proj.weight": "model-00003-of-00003.safetensors",
|
| 258 |
+
"model.layers.17.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 259 |
+
"model.layers.17.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
|
| 260 |
+
"model.layers.17.self_attn.k_proj.biases": "model-00003-of-00003.safetensors",
|
| 261 |
+
"model.layers.17.self_attn.k_proj.scales": "model-00003-of-00003.safetensors",
|
| 262 |
+
"model.layers.17.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
|
| 263 |
+
"model.layers.17.self_attn.o_proj.biases": "model-00003-of-00003.safetensors",
|
| 264 |
+
"model.layers.17.self_attn.o_proj.scales": "model-00003-of-00003.safetensors",
|
| 265 |
+
"model.layers.17.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
|
| 266 |
+
"model.layers.17.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
|
| 267 |
+
"model.layers.17.self_attn.q_proj.biases": "model-00003-of-00003.safetensors",
|
| 268 |
+
"model.layers.17.self_attn.q_proj.scales": "model-00003-of-00003.safetensors",
|
| 269 |
+
"model.layers.17.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
|
| 270 |
+
"model.layers.17.self_attn.v_proj.biases": "model-00003-of-00003.safetensors",
|
| 271 |
+
"model.layers.17.self_attn.v_proj.scales": "model-00003-of-00003.safetensors",
|
| 272 |
+
"model.layers.17.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
|
| 273 |
+
"model.layers.18.input_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 274 |
+
"model.layers.18.mlp.gate.biases": "model-00003-of-00003.safetensors",
|
| 275 |
+
"model.layers.18.mlp.gate.scales": "model-00003-of-00003.safetensors",
|
| 276 |
+
"model.layers.18.mlp.gate.weight": "model-00003-of-00003.safetensors",
|
| 277 |
+
"model.layers.18.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
|
| 278 |
+
"model.layers.18.mlp.switch_mlp.gate_proj.biases": "model-00003-of-00003.safetensors",
|
| 279 |
+
"model.layers.18.mlp.switch_mlp.gate_proj.scales": "model-00003-of-00003.safetensors",
|
| 280 |
+
"model.layers.18.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
|
| 281 |
+
"model.layers.18.mlp.switch_mlp.up_proj.biases": "model-00003-of-00003.safetensors",
|
| 282 |
+
"model.layers.18.mlp.switch_mlp.up_proj.scales": "model-00003-of-00003.safetensors",
|
| 283 |
+
"model.layers.18.mlp.switch_mlp.up_proj.weight": "model-00003-of-00003.safetensors",
|
| 284 |
+
"model.layers.18.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 285 |
+
"model.layers.18.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
|
| 286 |
+
"model.layers.18.self_attn.k_proj.biases": "model-00003-of-00003.safetensors",
|
| 287 |
+
"model.layers.18.self_attn.k_proj.scales": "model-00003-of-00003.safetensors",
|
| 288 |
+
"model.layers.18.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
|
| 289 |
+
"model.layers.18.self_attn.o_proj.biases": "model-00003-of-00003.safetensors",
|
| 290 |
+
"model.layers.18.self_attn.o_proj.scales": "model-00003-of-00003.safetensors",
|
| 291 |
+
"model.layers.18.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
|
| 292 |
+
"model.layers.18.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
|
| 293 |
+
"model.layers.18.self_attn.q_proj.biases": "model-00003-of-00003.safetensors",
|
| 294 |
+
"model.layers.18.self_attn.q_proj.scales": "model-00003-of-00003.safetensors",
|
| 295 |
+
"model.layers.18.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
|
| 296 |
+
"model.layers.18.self_attn.v_proj.biases": "model-00003-of-00003.safetensors",
|
| 297 |
+
"model.layers.18.self_attn.v_proj.scales": "model-00003-of-00003.safetensors",
|
| 298 |
+
"model.layers.18.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
|
| 299 |
+
"model.layers.19.input_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 300 |
+
"model.layers.19.mlp.gate.biases": "model-00003-of-00003.safetensors",
|
| 301 |
+
"model.layers.19.mlp.gate.scales": "model-00003-of-00003.safetensors",
|
| 302 |
+
"model.layers.19.mlp.gate.weight": "model-00003-of-00003.safetensors",
|
| 303 |
+
"model.layers.19.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
|
| 304 |
+
"model.layers.19.mlp.switch_mlp.gate_proj.biases": "model-00003-of-00003.safetensors",
|
| 305 |
+
"model.layers.19.mlp.switch_mlp.gate_proj.scales": "model-00003-of-00003.safetensors",
|
| 306 |
+
"model.layers.19.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
|
| 307 |
+
"model.layers.19.mlp.switch_mlp.up_proj.biases": "model-00003-of-00003.safetensors",
|
| 308 |
+
"model.layers.19.mlp.switch_mlp.up_proj.scales": "model-00003-of-00003.safetensors",
|
| 309 |
+
"model.layers.19.mlp.switch_mlp.up_proj.weight": "model-00003-of-00003.safetensors",
|
| 310 |
+
"model.layers.19.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 311 |
+
"model.layers.19.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
|
| 312 |
+
"model.layers.19.self_attn.k_proj.biases": "model-00003-of-00003.safetensors",
|
| 313 |
+
"model.layers.19.self_attn.k_proj.scales": "model-00003-of-00003.safetensors",
|
| 314 |
+
"model.layers.19.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
|
| 315 |
+
"model.layers.19.self_attn.o_proj.biases": "model-00003-of-00003.safetensors",
|
| 316 |
+
"model.layers.19.self_attn.o_proj.scales": "model-00003-of-00003.safetensors",
|
| 317 |
+
"model.layers.19.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
|
| 318 |
+
"model.layers.19.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
|
| 319 |
+
"model.layers.19.self_attn.q_proj.biases": "model-00003-of-00003.safetensors",
|
| 320 |
+
"model.layers.19.self_attn.q_proj.scales": "model-00003-of-00003.safetensors",
|
| 321 |
+
"model.layers.19.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
|
| 322 |
+
"model.layers.19.self_attn.v_proj.biases": "model-00003-of-00003.safetensors",
|
| 323 |
+
"model.layers.19.self_attn.v_proj.scales": "model-00003-of-00003.safetensors",
|
| 324 |
+
"model.layers.19.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
|
| 325 |
+
"model.layers.2.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 326 |
+
"model.layers.2.mlp.gate.biases": "model-00001-of-00003.safetensors",
|
| 327 |
+
"model.layers.2.mlp.gate.scales": "model-00001-of-00003.safetensors",
|
| 328 |
+
"model.layers.2.mlp.gate.weight": "model-00001-of-00003.safetensors",
|
| 329 |
+
"model.layers.2.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
|
| 330 |
+
"model.layers.2.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
|
| 331 |
+
"model.layers.2.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
|
| 332 |
+
"model.layers.2.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
|
| 333 |
+
"model.layers.2.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
|
| 334 |
+
"model.layers.2.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
|
| 335 |
+
"model.layers.2.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
|
| 336 |
+
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 337 |
+
"model.layers.2.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
|
| 338 |
+
"model.layers.2.self_attn.k_proj.biases": "model-00001-of-00003.safetensors",
|
| 339 |
+
"model.layers.2.self_attn.k_proj.scales": "model-00001-of-00003.safetensors",
|
| 340 |
+
"model.layers.2.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
|
| 341 |
+
"model.layers.2.self_attn.o_proj.biases": "model-00001-of-00003.safetensors",
|
| 342 |
+
"model.layers.2.self_attn.o_proj.scales": "model-00001-of-00003.safetensors",
|
| 343 |
+
"model.layers.2.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
|
| 344 |
+
"model.layers.2.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
|
| 345 |
+
"model.layers.2.self_attn.q_proj.biases": "model-00001-of-00003.safetensors",
|
| 346 |
+
"model.layers.2.self_attn.q_proj.scales": "model-00001-of-00003.safetensors",
|
| 347 |
+
"model.layers.2.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
|
| 348 |
+
"model.layers.2.self_attn.v_proj.biases": "model-00001-of-00003.safetensors",
|
| 349 |
+
"model.layers.2.self_attn.v_proj.scales": "model-00001-of-00003.safetensors",
|
| 350 |
+
"model.layers.2.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
|
| 351 |
+
"model.layers.20.input_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 352 |
+
"model.layers.20.mlp.gate.biases": "model-00003-of-00003.safetensors",
|
| 353 |
+
"model.layers.20.mlp.gate.scales": "model-00003-of-00003.safetensors",
|
| 354 |
+
"model.layers.20.mlp.gate.weight": "model-00003-of-00003.safetensors",
|
| 355 |
+
"model.layers.20.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
|
| 356 |
+
"model.layers.20.mlp.switch_mlp.gate_proj.biases": "model-00003-of-00003.safetensors",
|
| 357 |
+
"model.layers.20.mlp.switch_mlp.gate_proj.scales": "model-00003-of-00003.safetensors",
|
| 358 |
+
"model.layers.20.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
|
| 359 |
+
"model.layers.20.mlp.switch_mlp.up_proj.biases": "model-00003-of-00003.safetensors",
|
| 360 |
+
"model.layers.20.mlp.switch_mlp.up_proj.scales": "model-00003-of-00003.safetensors",
|
| 361 |
+
"model.layers.20.mlp.switch_mlp.up_proj.weight": "model-00003-of-00003.safetensors",
|
| 362 |
+
"model.layers.20.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 363 |
+
"model.layers.20.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
|
| 364 |
+
"model.layers.20.self_attn.k_proj.biases": "model-00003-of-00003.safetensors",
|
| 365 |
+
"model.layers.20.self_attn.k_proj.scales": "model-00003-of-00003.safetensors",
|
| 366 |
+
"model.layers.20.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
|
| 367 |
+
"model.layers.20.self_attn.o_proj.biases": "model-00003-of-00003.safetensors",
|
| 368 |
+
"model.layers.20.self_attn.o_proj.scales": "model-00003-of-00003.safetensors",
|
| 369 |
+
"model.layers.20.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
|
| 370 |
+
"model.layers.20.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
|
| 371 |
+
"model.layers.20.self_attn.q_proj.biases": "model-00003-of-00003.safetensors",
|
| 372 |
+
"model.layers.20.self_attn.q_proj.scales": "model-00003-of-00003.safetensors",
|
| 373 |
+
"model.layers.20.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
|
| 374 |
+
"model.layers.20.self_attn.v_proj.biases": "model-00003-of-00003.safetensors",
|
| 375 |
+
"model.layers.20.self_attn.v_proj.scales": "model-00003-of-00003.safetensors",
|
| 376 |
+
"model.layers.20.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
|
| 377 |
+
"model.layers.21.input_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 378 |
+
"model.layers.21.mlp.gate.biases": "model-00003-of-00003.safetensors",
|
| 379 |
+
"model.layers.21.mlp.gate.scales": "model-00003-of-00003.safetensors",
|
| 380 |
+
"model.layers.21.mlp.gate.weight": "model-00003-of-00003.safetensors",
|
| 381 |
+
"model.layers.21.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
|
| 382 |
+
"model.layers.21.mlp.switch_mlp.gate_proj.biases": "model-00003-of-00003.safetensors",
|
| 383 |
+
"model.layers.21.mlp.switch_mlp.gate_proj.scales": "model-00003-of-00003.safetensors",
|
| 384 |
+
"model.layers.21.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
|
| 385 |
+
"model.layers.21.mlp.switch_mlp.up_proj.biases": "model-00003-of-00003.safetensors",
|
| 386 |
+
"model.layers.21.mlp.switch_mlp.up_proj.scales": "model-00003-of-00003.safetensors",
|
| 387 |
+
"model.layers.21.mlp.switch_mlp.up_proj.weight": "model-00003-of-00003.safetensors",
|
| 388 |
+
"model.layers.21.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 389 |
+
"model.layers.21.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
|
| 390 |
+
"model.layers.21.self_attn.k_proj.biases": "model-00003-of-00003.safetensors",
|
| 391 |
+
"model.layers.21.self_attn.k_proj.scales": "model-00003-of-00003.safetensors",
|
| 392 |
+
"model.layers.21.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
|
| 393 |
+
"model.layers.21.self_attn.o_proj.biases": "model-00003-of-00003.safetensors",
|
| 394 |
+
"model.layers.21.self_attn.o_proj.scales": "model-00003-of-00003.safetensors",
|
| 395 |
+
"model.layers.21.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
|
| 396 |
+
"model.layers.21.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
|
| 397 |
+
"model.layers.21.self_attn.q_proj.biases": "model-00003-of-00003.safetensors",
|
| 398 |
+
"model.layers.21.self_attn.q_proj.scales": "model-00003-of-00003.safetensors",
|
| 399 |
+
"model.layers.21.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
|
| 400 |
+
"model.layers.21.self_attn.v_proj.biases": "model-00003-of-00003.safetensors",
|
| 401 |
+
"model.layers.21.self_attn.v_proj.scales": "model-00003-of-00003.safetensors",
|
| 402 |
+
"model.layers.21.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
|
| 403 |
+
"model.layers.22.input_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 404 |
+
"model.layers.22.mlp.gate.biases": "model-00003-of-00003.safetensors",
|
| 405 |
+
"model.layers.22.mlp.gate.scales": "model-00003-of-00003.safetensors",
|
| 406 |
+
"model.layers.22.mlp.gate.weight": "model-00003-of-00003.safetensors",
|
| 407 |
+
"model.layers.22.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
|
| 408 |
+
"model.layers.22.mlp.switch_mlp.gate_proj.biases": "model-00003-of-00003.safetensors",
|
| 409 |
+
"model.layers.22.mlp.switch_mlp.gate_proj.scales": "model-00003-of-00003.safetensors",
|
| 410 |
+
"model.layers.22.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
|
| 411 |
+
"model.layers.22.mlp.switch_mlp.up_proj.biases": "model-00003-of-00003.safetensors",
|
| 412 |
+
"model.layers.22.mlp.switch_mlp.up_proj.scales": "model-00003-of-00003.safetensors",
|
| 413 |
+
"model.layers.22.mlp.switch_mlp.up_proj.weight": "model-00003-of-00003.safetensors",
|
| 414 |
+
"model.layers.22.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 415 |
+
"model.layers.22.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
|
| 416 |
+
"model.layers.22.self_attn.k_proj.biases": "model-00003-of-00003.safetensors",
|
| 417 |
+
"model.layers.22.self_attn.k_proj.scales": "model-00003-of-00003.safetensors",
|
| 418 |
+
"model.layers.22.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
|
| 419 |
+
"model.layers.22.self_attn.o_proj.biases": "model-00003-of-00003.safetensors",
|
| 420 |
+
"model.layers.22.self_attn.o_proj.scales": "model-00003-of-00003.safetensors",
|
| 421 |
+
"model.layers.22.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
|
| 422 |
+
"model.layers.22.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
|
| 423 |
+
"model.layers.22.self_attn.q_proj.biases": "model-00003-of-00003.safetensors",
|
| 424 |
+
"model.layers.22.self_attn.q_proj.scales": "model-00003-of-00003.safetensors",
|
| 425 |
+
"model.layers.22.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
|
| 426 |
+
"model.layers.22.self_attn.v_proj.biases": "model-00003-of-00003.safetensors",
|
| 427 |
+
"model.layers.22.self_attn.v_proj.scales": "model-00003-of-00003.safetensors",
|
| 428 |
+
"model.layers.22.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
|
| 429 |
+
"model.layers.23.input_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 430 |
+
"model.layers.23.mlp.gate.biases": "model-00003-of-00003.safetensors",
|
| 431 |
+
"model.layers.23.mlp.gate.scales": "model-00003-of-00003.safetensors",
|
| 432 |
+
"model.layers.23.mlp.gate.weight": "model-00003-of-00003.safetensors",
|
| 433 |
+
"model.layers.23.mlp.switch_mlp.down_proj.weight": "model-00003-of-00003.safetensors",
|
| 434 |
+
"model.layers.23.mlp.switch_mlp.gate_proj.biases": "model-00003-of-00003.safetensors",
|
| 435 |
+
"model.layers.23.mlp.switch_mlp.gate_proj.scales": "model-00003-of-00003.safetensors",
|
| 436 |
+
"model.layers.23.mlp.switch_mlp.gate_proj.weight": "model-00003-of-00003.safetensors",
|
| 437 |
+
"model.layers.23.mlp.switch_mlp.up_proj.biases": "model-00003-of-00003.safetensors",
|
| 438 |
+
"model.layers.23.mlp.switch_mlp.up_proj.scales": "model-00003-of-00003.safetensors",
|
| 439 |
+
"model.layers.23.mlp.switch_mlp.up_proj.weight": "model-00003-of-00003.safetensors",
|
| 440 |
+
"model.layers.23.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
|
| 441 |
+
"model.layers.23.self_attn.k_norm.weight": "model-00003-of-00003.safetensors",
|
| 442 |
+
"model.layers.23.self_attn.k_proj.biases": "model-00003-of-00003.safetensors",
|
| 443 |
+
"model.layers.23.self_attn.k_proj.scales": "model-00003-of-00003.safetensors",
|
| 444 |
+
"model.layers.23.self_attn.k_proj.weight": "model-00003-of-00003.safetensors",
|
| 445 |
+
"model.layers.23.self_attn.o_proj.biases": "model-00003-of-00003.safetensors",
|
| 446 |
+
"model.layers.23.self_attn.o_proj.scales": "model-00003-of-00003.safetensors",
|
| 447 |
+
"model.layers.23.self_attn.o_proj.weight": "model-00003-of-00003.safetensors",
|
| 448 |
+
"model.layers.23.self_attn.q_norm.weight": "model-00003-of-00003.safetensors",
|
| 449 |
+
"model.layers.23.self_attn.q_proj.biases": "model-00003-of-00003.safetensors",
|
| 450 |
+
"model.layers.23.self_attn.q_proj.scales": "model-00003-of-00003.safetensors",
|
| 451 |
+
"model.layers.23.self_attn.q_proj.weight": "model-00003-of-00003.safetensors",
|
| 452 |
+
"model.layers.23.self_attn.v_proj.biases": "model-00003-of-00003.safetensors",
|
| 453 |
+
"model.layers.23.self_attn.v_proj.scales": "model-00003-of-00003.safetensors",
|
| 454 |
+
"model.layers.23.self_attn.v_proj.weight": "model-00003-of-00003.safetensors",
|
| 455 |
+
"model.layers.3.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 456 |
+
"model.layers.3.mlp.gate.biases": "model-00001-of-00003.safetensors",
|
| 457 |
+
"model.layers.3.mlp.gate.scales": "model-00001-of-00003.safetensors",
|
| 458 |
+
"model.layers.3.mlp.gate.weight": "model-00001-of-00003.safetensors",
|
| 459 |
+
"model.layers.3.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
|
| 460 |
+
"model.layers.3.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
|
| 461 |
+
"model.layers.3.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
|
| 462 |
+
"model.layers.3.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
|
| 463 |
+
"model.layers.3.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
|
| 464 |
+
"model.layers.3.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
|
| 465 |
+
"model.layers.3.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
|
| 466 |
+
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 467 |
+
"model.layers.3.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
|
| 468 |
+
"model.layers.3.self_attn.k_proj.biases": "model-00001-of-00003.safetensors",
|
| 469 |
+
"model.layers.3.self_attn.k_proj.scales": "model-00001-of-00003.safetensors",
|
| 470 |
+
"model.layers.3.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
|
| 471 |
+
"model.layers.3.self_attn.o_proj.biases": "model-00001-of-00003.safetensors",
|
| 472 |
+
"model.layers.3.self_attn.o_proj.scales": "model-00001-of-00003.safetensors",
|
| 473 |
+
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
|
| 474 |
+
"model.layers.3.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
|
| 475 |
+
"model.layers.3.self_attn.q_proj.biases": "model-00001-of-00003.safetensors",
|
| 476 |
+
"model.layers.3.self_attn.q_proj.scales": "model-00001-of-00003.safetensors",
|
| 477 |
+
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
|
| 478 |
+
"model.layers.3.self_attn.v_proj.biases": "model-00001-of-00003.safetensors",
|
| 479 |
+
"model.layers.3.self_attn.v_proj.scales": "model-00001-of-00003.safetensors",
|
| 480 |
+
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
|
| 481 |
+
"model.layers.4.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 482 |
+
"model.layers.4.mlp.gate.biases": "model-00001-of-00003.safetensors",
|
| 483 |
+
"model.layers.4.mlp.gate.scales": "model-00001-of-00003.safetensors",
|
| 484 |
+
"model.layers.4.mlp.gate.weight": "model-00001-of-00003.safetensors",
|
| 485 |
+
"model.layers.4.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
|
| 486 |
+
"model.layers.4.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
|
| 487 |
+
"model.layers.4.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
|
| 488 |
+
"model.layers.4.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
|
| 489 |
+
"model.layers.4.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
|
| 490 |
+
"model.layers.4.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
|
| 491 |
+
"model.layers.4.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
|
| 492 |
+
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 493 |
+
"model.layers.4.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
|
| 494 |
+
"model.layers.4.self_attn.k_proj.biases": "model-00001-of-00003.safetensors",
|
| 495 |
+
"model.layers.4.self_attn.k_proj.scales": "model-00001-of-00003.safetensors",
|
| 496 |
+
"model.layers.4.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
|
| 497 |
+
"model.layers.4.self_attn.o_proj.biases": "model-00001-of-00003.safetensors",
|
| 498 |
+
"model.layers.4.self_attn.o_proj.scales": "model-00001-of-00003.safetensors",
|
| 499 |
+
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
|
| 500 |
+
"model.layers.4.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
|
| 501 |
+
"model.layers.4.self_attn.q_proj.biases": "model-00001-of-00003.safetensors",
|
| 502 |
+
"model.layers.4.self_attn.q_proj.scales": "model-00001-of-00003.safetensors",
|
| 503 |
+
"model.layers.4.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
|
| 504 |
+
"model.layers.4.self_attn.v_proj.biases": "model-00001-of-00003.safetensors",
|
| 505 |
+
"model.layers.4.self_attn.v_proj.scales": "model-00001-of-00003.safetensors",
|
| 506 |
+
"model.layers.4.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
|
| 507 |
+
"model.layers.5.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 508 |
+
"model.layers.5.mlp.gate.biases": "model-00001-of-00003.safetensors",
|
| 509 |
+
"model.layers.5.mlp.gate.scales": "model-00001-of-00003.safetensors",
|
| 510 |
+
"model.layers.5.mlp.gate.weight": "model-00001-of-00003.safetensors",
|
| 511 |
+
"model.layers.5.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
|
| 512 |
+
"model.layers.5.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
|
| 513 |
+
"model.layers.5.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
|
| 514 |
+
"model.layers.5.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
|
| 515 |
+
"model.layers.5.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
|
| 516 |
+
"model.layers.5.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
|
| 517 |
+
"model.layers.5.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
|
| 518 |
+
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 519 |
+
"model.layers.5.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
|
| 520 |
+
"model.layers.5.self_attn.k_proj.biases": "model-00001-of-00003.safetensors",
|
| 521 |
+
"model.layers.5.self_attn.k_proj.scales": "model-00001-of-00003.safetensors",
|
| 522 |
+
"model.layers.5.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
|
| 523 |
+
"model.layers.5.self_attn.o_proj.biases": "model-00001-of-00003.safetensors",
|
| 524 |
+
"model.layers.5.self_attn.o_proj.scales": "model-00001-of-00003.safetensors",
|
| 525 |
+
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
|
| 526 |
+
"model.layers.5.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
|
| 527 |
+
"model.layers.5.self_attn.q_proj.biases": "model-00001-of-00003.safetensors",
|
| 528 |
+
"model.layers.5.self_attn.q_proj.scales": "model-00001-of-00003.safetensors",
|
| 529 |
+
"model.layers.5.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
|
| 530 |
+
"model.layers.5.self_attn.v_proj.biases": "model-00001-of-00003.safetensors",
|
| 531 |
+
"model.layers.5.self_attn.v_proj.scales": "model-00001-of-00003.safetensors",
|
| 532 |
+
"model.layers.5.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
|
| 533 |
+
"model.layers.6.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 534 |
+
"model.layers.6.mlp.gate.biases": "model-00001-of-00003.safetensors",
|
| 535 |
+
"model.layers.6.mlp.gate.scales": "model-00001-of-00003.safetensors",
|
| 536 |
+
"model.layers.6.mlp.gate.weight": "model-00001-of-00003.safetensors",
|
| 537 |
+
"model.layers.6.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
|
| 538 |
+
"model.layers.6.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
|
| 539 |
+
"model.layers.6.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
|
| 540 |
+
"model.layers.6.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
|
| 541 |
+
"model.layers.6.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
|
| 542 |
+
"model.layers.6.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
|
| 543 |
+
"model.layers.6.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
|
| 544 |
+
"model.layers.6.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 545 |
+
"model.layers.6.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
|
| 546 |
+
"model.layers.6.self_attn.k_proj.biases": "model-00001-of-00003.safetensors",
|
| 547 |
+
"model.layers.6.self_attn.k_proj.scales": "model-00001-of-00003.safetensors",
|
| 548 |
+
"model.layers.6.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
|
| 549 |
+
"model.layers.6.self_attn.o_proj.biases": "model-00001-of-00003.safetensors",
|
| 550 |
+
"model.layers.6.self_attn.o_proj.scales": "model-00001-of-00003.safetensors",
|
| 551 |
+
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
|
| 552 |
+
"model.layers.6.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
|
| 553 |
+
"model.layers.6.self_attn.q_proj.biases": "model-00001-of-00003.safetensors",
|
| 554 |
+
"model.layers.6.self_attn.q_proj.scales": "model-00001-of-00003.safetensors",
|
| 555 |
+
"model.layers.6.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
|
| 556 |
+
"model.layers.6.self_attn.v_proj.biases": "model-00001-of-00003.safetensors",
|
| 557 |
+
"model.layers.6.self_attn.v_proj.scales": "model-00001-of-00003.safetensors",
|
| 558 |
+
"model.layers.6.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
|
| 559 |
+
"model.layers.7.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 560 |
+
"model.layers.7.mlp.gate.biases": "model-00001-of-00003.safetensors",
|
| 561 |
+
"model.layers.7.mlp.gate.scales": "model-00001-of-00003.safetensors",
|
| 562 |
+
"model.layers.7.mlp.gate.weight": "model-00001-of-00003.safetensors",
|
| 563 |
+
"model.layers.7.mlp.switch_mlp.down_proj.weight": "model-00001-of-00003.safetensors",
|
| 564 |
+
"model.layers.7.mlp.switch_mlp.gate_proj.biases": "model-00001-of-00003.safetensors",
|
| 565 |
+
"model.layers.7.mlp.switch_mlp.gate_proj.scales": "model-00001-of-00003.safetensors",
|
| 566 |
+
"model.layers.7.mlp.switch_mlp.gate_proj.weight": "model-00001-of-00003.safetensors",
|
| 567 |
+
"model.layers.7.mlp.switch_mlp.up_proj.biases": "model-00001-of-00003.safetensors",
|
| 568 |
+
"model.layers.7.mlp.switch_mlp.up_proj.scales": "model-00001-of-00003.safetensors",
|
| 569 |
+
"model.layers.7.mlp.switch_mlp.up_proj.weight": "model-00001-of-00003.safetensors",
|
| 570 |
+
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
| 571 |
+
"model.layers.7.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
|
| 572 |
+
"model.layers.7.self_attn.k_proj.biases": "model-00001-of-00003.safetensors",
|
| 573 |
+
"model.layers.7.self_attn.k_proj.scales": "model-00001-of-00003.safetensors",
|
| 574 |
+
"model.layers.7.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
|
| 575 |
+
"model.layers.7.self_attn.o_proj.biases": "model-00001-of-00003.safetensors",
|
| 576 |
+
"model.layers.7.self_attn.o_proj.scales": "model-00001-of-00003.safetensors",
|
| 577 |
+
"model.layers.7.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
|
| 578 |
+
"model.layers.7.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
|
| 579 |
+
"model.layers.7.self_attn.q_proj.biases": "model-00001-of-00003.safetensors",
|
| 580 |
+
"model.layers.7.self_attn.q_proj.scales": "model-00001-of-00003.safetensors",
|
| 581 |
+
"model.layers.7.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
|
| 582 |
+
"model.layers.7.self_attn.v_proj.biases": "model-00001-of-00003.safetensors",
|
| 583 |
+
"model.layers.7.self_attn.v_proj.scales": "model-00001-of-00003.safetensors",
|
| 584 |
+
"model.layers.7.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
|
| 585 |
+
"model.layers.8.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 586 |
+
"model.layers.8.mlp.gate.biases": "model-00001-of-00003.safetensors",
|
| 587 |
+
"model.layers.8.mlp.gate.scales": "model-00001-of-00003.safetensors",
|
| 588 |
+
"model.layers.8.mlp.gate.weight": "model-00001-of-00003.safetensors",
|
| 589 |
+
"model.layers.8.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
|
| 590 |
+
"model.layers.8.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
|
| 591 |
+
"model.layers.8.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
|
| 592 |
+
"model.layers.8.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
|
| 593 |
+
"model.layers.8.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
|
| 594 |
+
"model.layers.8.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
|
| 595 |
+
"model.layers.8.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
|
| 596 |
+
"model.layers.8.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 597 |
+
"model.layers.8.self_attn.k_norm.weight": "model-00001-of-00003.safetensors",
|
| 598 |
+
"model.layers.8.self_attn.k_proj.biases": "model-00001-of-00003.safetensors",
|
| 599 |
+
"model.layers.8.self_attn.k_proj.scales": "model-00001-of-00003.safetensors",
|
| 600 |
+
"model.layers.8.self_attn.k_proj.weight": "model-00001-of-00003.safetensors",
|
| 601 |
+
"model.layers.8.self_attn.o_proj.biases": "model-00001-of-00003.safetensors",
|
| 602 |
+
"model.layers.8.self_attn.o_proj.scales": "model-00001-of-00003.safetensors",
|
| 603 |
+
"model.layers.8.self_attn.o_proj.weight": "model-00001-of-00003.safetensors",
|
| 604 |
+
"model.layers.8.self_attn.q_norm.weight": "model-00001-of-00003.safetensors",
|
| 605 |
+
"model.layers.8.self_attn.q_proj.biases": "model-00001-of-00003.safetensors",
|
| 606 |
+
"model.layers.8.self_attn.q_proj.scales": "model-00001-of-00003.safetensors",
|
| 607 |
+
"model.layers.8.self_attn.q_proj.weight": "model-00001-of-00003.safetensors",
|
| 608 |
+
"model.layers.8.self_attn.v_proj.biases": "model-00001-of-00003.safetensors",
|
| 609 |
+
"model.layers.8.self_attn.v_proj.scales": "model-00001-of-00003.safetensors",
|
| 610 |
+
"model.layers.8.self_attn.v_proj.weight": "model-00001-of-00003.safetensors",
|
| 611 |
+
"model.layers.9.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 612 |
+
"model.layers.9.mlp.gate.biases": "model-00002-of-00003.safetensors",
|
| 613 |
+
"model.layers.9.mlp.gate.scales": "model-00002-of-00003.safetensors",
|
| 614 |
+
"model.layers.9.mlp.gate.weight": "model-00002-of-00003.safetensors",
|
| 615 |
+
"model.layers.9.mlp.switch_mlp.down_proj.weight": "model-00002-of-00003.safetensors",
|
| 616 |
+
"model.layers.9.mlp.switch_mlp.gate_proj.biases": "model-00002-of-00003.safetensors",
|
| 617 |
+
"model.layers.9.mlp.switch_mlp.gate_proj.scales": "model-00002-of-00003.safetensors",
|
| 618 |
+
"model.layers.9.mlp.switch_mlp.gate_proj.weight": "model-00002-of-00003.safetensors",
|
| 619 |
+
"model.layers.9.mlp.switch_mlp.up_proj.biases": "model-00002-of-00003.safetensors",
|
| 620 |
+
"model.layers.9.mlp.switch_mlp.up_proj.scales": "model-00002-of-00003.safetensors",
|
| 621 |
+
"model.layers.9.mlp.switch_mlp.up_proj.weight": "model-00002-of-00003.safetensors",
|
| 622 |
+
"model.layers.9.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
| 623 |
+
"model.layers.9.self_attn.k_norm.weight": "model-00002-of-00003.safetensors",
|
| 624 |
+
"model.layers.9.self_attn.k_proj.biases": "model-00002-of-00003.safetensors",
|
| 625 |
+
"model.layers.9.self_attn.k_proj.scales": "model-00002-of-00003.safetensors",
|
| 626 |
+
"model.layers.9.self_attn.k_proj.weight": "model-00002-of-00003.safetensors",
|
| 627 |
+
"model.layers.9.self_attn.o_proj.biases": "model-00002-of-00003.safetensors",
|
| 628 |
+
"model.layers.9.self_attn.o_proj.scales": "model-00002-of-00003.safetensors",
|
| 629 |
+
"model.layers.9.self_attn.o_proj.weight": "model-00002-of-00003.safetensors",
|
| 630 |
+
"model.layers.9.self_attn.q_norm.weight": "model-00002-of-00003.safetensors",
|
| 631 |
+
"model.layers.9.self_attn.q_proj.biases": "model-00002-of-00003.safetensors",
|
| 632 |
+
"model.layers.9.self_attn.q_proj.scales": "model-00002-of-00003.safetensors",
|
| 633 |
+
"model.layers.9.self_attn.q_proj.weight": "model-00002-of-00003.safetensors",
|
| 634 |
+
"model.layers.9.self_attn.v_proj.biases": "model-00002-of-00003.safetensors",
|
| 635 |
+
"model.layers.9.self_attn.v_proj.scales": "model-00002-of-00003.safetensors",
|
| 636 |
+
"model.layers.9.self_attn.v_proj.weight": "model-00002-of-00003.safetensors",
|
| 637 |
+
"model.norm.weight": "model-00003-of-00003.safetensors"
|
| 638 |
+
}
|
| 639 |
+
}
|
modeling_enggpt_moe.py
ADDED
|
@@ -0,0 +1,688 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
|
| 2 |
+
# This file was automatically generated from src/transformers/models/enggpt_moe/modular_enggpt_moe.py.
|
| 3 |
+
# Do NOT edit this file manually as any edits will be overwritten by the generation of
|
| 4 |
+
# the file from the modular. If any change should be done, please apply the change to the
|
| 5 |
+
# modular_enggpt_moe.py file directly. One of our CI enforces this.
|
| 6 |
+
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
|
| 7 |
+
|
| 8 |
+
from typing import Callable, Optional, Union
|
| 9 |
+
|
| 10 |
+
import torch
|
| 11 |
+
import torch.nn.functional as F
|
| 12 |
+
from torch import nn
|
| 13 |
+
|
| 14 |
+
from transformers.activations import ACT2FN
|
| 15 |
+
from transformers.cache_utils import Cache, DynamicCache
|
| 16 |
+
from transformers.generation import GenerationMixin
|
| 17 |
+
from transformers.integrations import use_kernel_forward_from_hub
|
| 18 |
+
from transformers.masking_utils import create_causal_mask, create_sliding_window_causal_mask
|
| 19 |
+
from transformers.modeling_flash_attention_utils import FlashAttentionKwargs
|
| 20 |
+
from transformers.modeling_layers import (
|
| 21 |
+
GenericForQuestionAnswering,
|
| 22 |
+
GenericForSequenceClassification,
|
| 23 |
+
GenericForTokenClassification,
|
| 24 |
+
GradientCheckpointingLayer,
|
| 25 |
+
)
|
| 26 |
+
from transformers.modeling_outputs import MoeCausalLMOutputWithPast, MoeModelOutputWithPast
|
| 27 |
+
from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_update
|
| 28 |
+
from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
|
| 29 |
+
from transformers.processing_utils import Unpack
|
| 30 |
+
from transformers.utils import TransformersKwargs, auto_docstring, can_return_tuple
|
| 31 |
+
from transformers.utils.deprecation import deprecate_kwarg
|
| 32 |
+
from transformers.utils.generic import OutputRecorder, check_model_inputs
|
| 33 |
+
from .configuration_enggpt_moe import EngGPTMoeConfig
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def rotate_half(x):
|
| 37 |
+
"""Rotates half the hidden dims of the input."""
|
| 38 |
+
x1 = x[..., : x.shape[-1] // 2]
|
| 39 |
+
x2 = x[..., x.shape[-1] // 2 :]
|
| 40 |
+
return torch.cat((-x2, x1), dim=-1)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_dim=1):
|
| 44 |
+
"""Applies Rotary Position Embedding to the query and key tensors.
|
| 45 |
+
|
| 46 |
+
Args:
|
| 47 |
+
q (`torch.Tensor`): The query tensor.
|
| 48 |
+
k (`torch.Tensor`): The key tensor.
|
| 49 |
+
cos (`torch.Tensor`): The cosine part of the rotary embedding.
|
| 50 |
+
sin (`torch.Tensor`): The sine part of the rotary embedding.
|
| 51 |
+
position_ids (`torch.Tensor`, *optional*):
|
| 52 |
+
Deprecated and unused.
|
| 53 |
+
unsqueeze_dim (`int`, *optional*, defaults to 1):
|
| 54 |
+
The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
|
| 55 |
+
sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
|
| 56 |
+
that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
|
| 57 |
+
k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
|
| 58 |
+
cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
|
| 59 |
+
the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
|
| 60 |
+
Returns:
|
| 61 |
+
`tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
|
| 62 |
+
"""
|
| 63 |
+
cos = cos.unsqueeze(unsqueeze_dim)
|
| 64 |
+
sin = sin.unsqueeze(unsqueeze_dim)
|
| 65 |
+
q_embed = (q * cos) + (rotate_half(q) * sin)
|
| 66 |
+
k_embed = (k * cos) + (rotate_half(k) * sin)
|
| 67 |
+
return q_embed, k_embed
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
|
| 71 |
+
"""
|
| 72 |
+
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
|
| 73 |
+
num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
|
| 74 |
+
"""
|
| 75 |
+
batch, num_key_value_heads, slen, head_dim = hidden_states.shape
|
| 76 |
+
if n_rep == 1:
|
| 77 |
+
return hidden_states
|
| 78 |
+
hidden_states = hidden_states[:, :, None, :, :].expand(batch, num_key_value_heads, n_rep, slen, head_dim)
|
| 79 |
+
return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
def eager_attention_forward(
|
| 83 |
+
module: nn.Module,
|
| 84 |
+
query: torch.Tensor,
|
| 85 |
+
key: torch.Tensor,
|
| 86 |
+
value: torch.Tensor,
|
| 87 |
+
attention_mask: Optional[torch.Tensor],
|
| 88 |
+
scaling: float,
|
| 89 |
+
dropout: float = 0.0,
|
| 90 |
+
**kwargs: Unpack[TransformersKwargs],
|
| 91 |
+
):
|
| 92 |
+
key_states = repeat_kv(key, module.num_key_value_groups)
|
| 93 |
+
value_states = repeat_kv(value, module.num_key_value_groups)
|
| 94 |
+
|
| 95 |
+
attn_weights = torch.matmul(query, key_states.transpose(2, 3)) * scaling
|
| 96 |
+
if attention_mask is not None:
|
| 97 |
+
causal_mask = attention_mask[:, :, :, : key_states.shape[-2]]
|
| 98 |
+
attn_weights = attn_weights + causal_mask
|
| 99 |
+
|
| 100 |
+
attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(query.dtype)
|
| 101 |
+
attn_weights = nn.functional.dropout(attn_weights, p=dropout, training=module.training)
|
| 102 |
+
attn_output = torch.matmul(attn_weights, value_states)
|
| 103 |
+
attn_output = attn_output.transpose(1, 2).contiguous()
|
| 104 |
+
|
| 105 |
+
return attn_output, attn_weights
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
class EngGPTMoeAttention(nn.Module):
|
| 109 |
+
"""Multi-headed attention from 'Attention Is All You Need' paper"""
|
| 110 |
+
|
| 111 |
+
def __init__(self, config: EngGPTMoeConfig, layer_idx: int):
|
| 112 |
+
super().__init__()
|
| 113 |
+
self.config = config
|
| 114 |
+
self.layer_idx = layer_idx
|
| 115 |
+
self.head_dim = getattr(config, "head_dim", config.hidden_size // config.num_attention_heads)
|
| 116 |
+
self.num_key_value_groups = config.num_attention_heads // config.num_key_value_heads
|
| 117 |
+
self.scaling = self.head_dim**-0.5
|
| 118 |
+
self.attention_dropout = config.attention_dropout
|
| 119 |
+
self.is_causal = True
|
| 120 |
+
|
| 121 |
+
self.q_proj = nn.Linear(
|
| 122 |
+
config.hidden_size, config.num_attention_heads * self.head_dim, bias=config.attention_bias
|
| 123 |
+
)
|
| 124 |
+
self.k_proj = nn.Linear(
|
| 125 |
+
config.hidden_size, config.num_key_value_heads * self.head_dim, bias=config.attention_bias
|
| 126 |
+
)
|
| 127 |
+
self.v_proj = nn.Linear(
|
| 128 |
+
config.hidden_size, config.num_key_value_heads * self.head_dim, bias=config.attention_bias
|
| 129 |
+
)
|
| 130 |
+
self.o_proj = nn.Linear(
|
| 131 |
+
config.num_attention_heads * self.head_dim, config.hidden_size, bias=config.attention_bias
|
| 132 |
+
)
|
| 133 |
+
self.q_norm = EngGPTMoeRMSNorm(self.head_dim, eps=config.rms_norm_eps) # unlike olmo, only on the head dim!
|
| 134 |
+
self.k_norm = EngGPTMoeRMSNorm(
|
| 135 |
+
self.head_dim, eps=config.rms_norm_eps
|
| 136 |
+
) # thus post q_norm does not need reshape
|
| 137 |
+
self.sliding_window = getattr(config, "sliding_window", None)
|
| 138 |
+
|
| 139 |
+
@deprecate_kwarg("past_key_value", new_name="past_key_values", version="4.58")
|
| 140 |
+
def forward(
|
| 141 |
+
self,
|
| 142 |
+
hidden_states: torch.Tensor,
|
| 143 |
+
position_embeddings: tuple[torch.Tensor, torch.Tensor],
|
| 144 |
+
attention_mask: Optional[torch.Tensor],
|
| 145 |
+
past_key_values: Optional[Cache] = None,
|
| 146 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 147 |
+
**kwargs: Unpack[FlashAttentionKwargs],
|
| 148 |
+
) -> tuple[torch.Tensor, Optional[torch.Tensor]]:
|
| 149 |
+
input_shape = hidden_states.shape[:-1]
|
| 150 |
+
hidden_shape = (*input_shape, -1, self.head_dim)
|
| 151 |
+
|
| 152 |
+
query_states = self.q_norm(self.q_proj(hidden_states).view(hidden_shape)).transpose(1, 2)
|
| 153 |
+
key_states = self.k_norm(self.k_proj(hidden_states).view(hidden_shape)).transpose(1, 2)
|
| 154 |
+
value_states = self.v_proj(hidden_states).view(hidden_shape).transpose(1, 2)
|
| 155 |
+
|
| 156 |
+
cos, sin = position_embeddings
|
| 157 |
+
query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
|
| 158 |
+
|
| 159 |
+
if past_key_values is not None:
|
| 160 |
+
# sin and cos are specific to RoPE models; cache_position needed for the static cache
|
| 161 |
+
cache_kwargs = {"sin": sin, "cos": cos, "cache_position": cache_position}
|
| 162 |
+
key_states, value_states = past_key_values.update(key_states, value_states, self.layer_idx, cache_kwargs)
|
| 163 |
+
|
| 164 |
+
attention_interface: Callable = eager_attention_forward
|
| 165 |
+
if self.config._attn_implementation != "eager":
|
| 166 |
+
attention_interface = ALL_ATTENTION_FUNCTIONS[self.config._attn_implementation]
|
| 167 |
+
|
| 168 |
+
attn_output, attn_weights = attention_interface(
|
| 169 |
+
self,
|
| 170 |
+
query_states,
|
| 171 |
+
key_states,
|
| 172 |
+
value_states,
|
| 173 |
+
attention_mask,
|
| 174 |
+
dropout=0.0 if not self.training else self.attention_dropout,
|
| 175 |
+
scaling=self.scaling,
|
| 176 |
+
sliding_window=self.sliding_window, # diff with Llama
|
| 177 |
+
**kwargs,
|
| 178 |
+
)
|
| 179 |
+
|
| 180 |
+
attn_output = attn_output.reshape(*input_shape, -1).contiguous()
|
| 181 |
+
attn_output = self.o_proj(attn_output)
|
| 182 |
+
return attn_output, attn_weights
|
| 183 |
+
|
| 184 |
+
|
| 185 |
+
class EngGPTMoeMLP(nn.Module):
|
| 186 |
+
def __init__(self, config, intermediate_size=None):
|
| 187 |
+
super().__init__()
|
| 188 |
+
self.config = config
|
| 189 |
+
self.hidden_size = config.hidden_size
|
| 190 |
+
self.intermediate_size = intermediate_size if intermediate_size is not None else config.intermediate_size
|
| 191 |
+
self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
|
| 192 |
+
self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
|
| 193 |
+
self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=False)
|
| 194 |
+
self.act_fn = ACT2FN[config.hidden_act]
|
| 195 |
+
|
| 196 |
+
def forward(self, x):
|
| 197 |
+
down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
|
| 198 |
+
return down_proj
|
| 199 |
+
|
| 200 |
+
|
| 201 |
+
class EngGPTMoeSparseMoeBlock(nn.Module):
|
| 202 |
+
def __init__(self, config):
|
| 203 |
+
super().__init__()
|
| 204 |
+
self.num_experts = config.num_experts
|
| 205 |
+
self.top_k = config.num_experts_per_tok
|
| 206 |
+
self.norm_topk_prob = config.norm_topk_prob
|
| 207 |
+
|
| 208 |
+
# gating
|
| 209 |
+
self.gate = nn.Linear(config.hidden_size, config.num_experts, bias=False)
|
| 210 |
+
self.experts = nn.ModuleList(
|
| 211 |
+
[EngGPTMoeMLP(config, intermediate_size=config.moe_intermediate_size) for _ in range(self.num_experts)]
|
| 212 |
+
)
|
| 213 |
+
|
| 214 |
+
def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
|
| 215 |
+
batch_size, sequence_length, hidden_dim = hidden_states.shape
|
| 216 |
+
hidden_states = hidden_states.view(-1, hidden_dim)
|
| 217 |
+
|
| 218 |
+
router_logits = self.gate(hidden_states)
|
| 219 |
+
|
| 220 |
+
routing_weights = F.softmax(router_logits, dim=1, dtype=torch.float)
|
| 221 |
+
routing_weights, selected_experts = torch.topk(routing_weights, self.top_k, dim=-1)
|
| 222 |
+
if self.norm_topk_prob:
|
| 223 |
+
routing_weights /= routing_weights.sum(dim=-1, keepdim=True)
|
| 224 |
+
|
| 225 |
+
routing_weights = routing_weights.to(hidden_states.dtype)
|
| 226 |
+
|
| 227 |
+
final_hidden_states = torch.zeros(
|
| 228 |
+
(batch_size * sequence_length, hidden_dim), dtype=hidden_states.dtype, device=hidden_states.device
|
| 229 |
+
)
|
| 230 |
+
|
| 231 |
+
expert_mask = torch.nn.functional.one_hot(selected_experts, num_classes=self.num_experts).permute(2, 1, 0)
|
| 232 |
+
|
| 233 |
+
expert_hit = torch.greater(expert_mask.sum(dim=(-1, -2)), 0).nonzero()
|
| 234 |
+
for expert_idx in expert_hit:
|
| 235 |
+
expert_layer = self.experts[expert_idx]
|
| 236 |
+
idx, top_x = torch.where(expert_mask[expert_idx].squeeze(0))
|
| 237 |
+
|
| 238 |
+
current_state = hidden_states[None, top_x].reshape(-1, hidden_dim)
|
| 239 |
+
current_hidden_states = expert_layer(current_state) * routing_weights[top_x, idx, None]
|
| 240 |
+
|
| 241 |
+
final_hidden_states.index_add_(0, top_x, current_hidden_states.to(hidden_states.dtype))
|
| 242 |
+
final_hidden_states = final_hidden_states.reshape(batch_size, sequence_length, hidden_dim)
|
| 243 |
+
return final_hidden_states, router_logits
|
| 244 |
+
|
| 245 |
+
|
| 246 |
+
@use_kernel_forward_from_hub("RMSNorm")
|
| 247 |
+
class EngGPTMoeRMSNorm(nn.Module):
|
| 248 |
+
def __init__(self, hidden_size, eps=1e-6):
|
| 249 |
+
"""
|
| 250 |
+
EngGPTMoeRMSNorm is equivalent to T5LayerNorm
|
| 251 |
+
"""
|
| 252 |
+
super().__init__()
|
| 253 |
+
self.weight = nn.Parameter(torch.ones(hidden_size))
|
| 254 |
+
self.variance_epsilon = eps
|
| 255 |
+
|
| 256 |
+
def forward(self, hidden_states):
|
| 257 |
+
input_dtype = hidden_states.dtype
|
| 258 |
+
hidden_states = hidden_states.to(torch.float32)
|
| 259 |
+
variance = hidden_states.pow(2).mean(-1, keepdim=True)
|
| 260 |
+
hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
|
| 261 |
+
return self.weight * hidden_states.to(input_dtype)
|
| 262 |
+
|
| 263 |
+
def extra_repr(self):
|
| 264 |
+
return f"{tuple(self.weight.shape)}, eps={self.variance_epsilon}"
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
class EngGPTMoeDecoderLayer(GradientCheckpointingLayer):
|
| 268 |
+
def __init__(self, config: EngGPTMoeConfig, layer_idx: int):
|
| 269 |
+
super().__init__()
|
| 270 |
+
self.hidden_size = config.hidden_size
|
| 271 |
+
|
| 272 |
+
self.self_attn = EngGPTMoeAttention(config, layer_idx)
|
| 273 |
+
|
| 274 |
+
if (layer_idx not in config.mlp_only_layers) and (
|
| 275 |
+
config.num_experts > 0 and (layer_idx + 1) % config.decoder_sparse_step == 0
|
| 276 |
+
):
|
| 277 |
+
self.mlp = EngGPTMoeSparseMoeBlock(config)
|
| 278 |
+
else:
|
| 279 |
+
self.mlp = EngGPTMoeMLP(config, intermediate_size=config.intermediate_size)
|
| 280 |
+
|
| 281 |
+
self.input_layernorm = EngGPTMoeRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
| 282 |
+
self.post_attention_layernorm = EngGPTMoeRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
| 283 |
+
|
| 284 |
+
@deprecate_kwarg("past_key_value", new_name="past_key_values", version="4.58")
|
| 285 |
+
def forward(
|
| 286 |
+
self,
|
| 287 |
+
hidden_states: torch.Tensor,
|
| 288 |
+
position_embeddings: tuple[torch.Tensor, torch.Tensor],
|
| 289 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 290 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 291 |
+
past_key_values: Optional[Cache] = None,
|
| 292 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 293 |
+
**kwargs: Unpack[FlashAttentionKwargs],
|
| 294 |
+
) -> torch.FloatTensor:
|
| 295 |
+
"""
|
| 296 |
+
Args:
|
| 297 |
+
hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)`
|
| 298 |
+
attention_mask (`torch.FloatTensor`, *optional*): attention mask of size
|
| 299 |
+
`(batch, sequence_length)` where padding elements are indicated by 0.
|
| 300 |
+
output_attentions (`bool`, *optional*):
|
| 301 |
+
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
|
| 302 |
+
returned tensors for more detail.
|
| 303 |
+
output_router_logits (`bool`, *optional*):
|
| 304 |
+
Whether or not to return the logits of all the routers. They are useful for computing the router loss,
|
| 305 |
+
and should not be returned during inference.
|
| 306 |
+
use_cache (`bool`, *optional*):
|
| 307 |
+
If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding
|
| 308 |
+
(see `past_key_values`).
|
| 309 |
+
past_key_values (`Cache`, *optional*): cached past key and value projection states
|
| 310 |
+
cache_position (`torch.LongTensor` of shape `(sequence_length)`, *optional*):
|
| 311 |
+
Indices depicting the position of the input sequence tokens in the sequence.
|
| 312 |
+
position_embeddings (`tuple[torch.FloatTensor, torch.FloatTensor]`, *optional*):
|
| 313 |
+
Tuple containing the cosine and sine positional embeddings of shape `(batch_size, seq_len, head_dim)`,
|
| 314 |
+
with `head_dim` being the embedding dimension of each attention head.
|
| 315 |
+
kwargs (`dict`, *optional*):
|
| 316 |
+
Arbitrary kwargs to be ignored, used for FSDP and other methods that injects code
|
| 317 |
+
into the model
|
| 318 |
+
"""
|
| 319 |
+
residual = hidden_states
|
| 320 |
+
|
| 321 |
+
hidden_states = self.input_layernorm(hidden_states)
|
| 322 |
+
|
| 323 |
+
hidden_states, _ = self.self_attn(
|
| 324 |
+
hidden_states=hidden_states,
|
| 325 |
+
position_embeddings=position_embeddings,
|
| 326 |
+
attention_mask=attention_mask,
|
| 327 |
+
position_ids=position_ids,
|
| 328 |
+
past_key_values=past_key_values,
|
| 329 |
+
cache_position=cache_position,
|
| 330 |
+
**kwargs,
|
| 331 |
+
)
|
| 332 |
+
hidden_states = residual + hidden_states
|
| 333 |
+
|
| 334 |
+
residual = hidden_states
|
| 335 |
+
hidden_states = self.post_attention_layernorm(hidden_states)
|
| 336 |
+
hidden_states = self.mlp(hidden_states)
|
| 337 |
+
|
| 338 |
+
if isinstance(hidden_states, tuple):
|
| 339 |
+
hidden_states, _ = hidden_states
|
| 340 |
+
hidden_states = residual + hidden_states
|
| 341 |
+
|
| 342 |
+
return hidden_states
|
| 343 |
+
|
| 344 |
+
|
| 345 |
+
class EngGPTMoeRotaryEmbedding(nn.Module):
|
| 346 |
+
inv_freq: torch.Tensor # fix linting for `register_buffer`
|
| 347 |
+
|
| 348 |
+
def __init__(self, config: EngGPTMoeConfig, device=None):
|
| 349 |
+
super().__init__()
|
| 350 |
+
# BC: "rope_type" was originally "type"
|
| 351 |
+
if hasattr(config, "rope_scaling") and isinstance(config.rope_scaling, dict):
|
| 352 |
+
self.rope_type = config.rope_scaling.get("rope_type", config.rope_scaling.get("type"))
|
| 353 |
+
else:
|
| 354 |
+
self.rope_type = "default"
|
| 355 |
+
self.max_seq_len_cached = config.max_position_embeddings
|
| 356 |
+
self.original_max_seq_len = config.max_position_embeddings
|
| 357 |
+
|
| 358 |
+
self.config = config
|
| 359 |
+
self.rope_init_fn = ROPE_INIT_FUNCTIONS[self.rope_type]
|
| 360 |
+
|
| 361 |
+
inv_freq, self.attention_scaling = self.rope_init_fn(self.config, device)
|
| 362 |
+
self.register_buffer("inv_freq", inv_freq, persistent=False)
|
| 363 |
+
self.original_inv_freq = self.inv_freq
|
| 364 |
+
|
| 365 |
+
@torch.no_grad()
|
| 366 |
+
@dynamic_rope_update # power user: used with advanced RoPE types (e.g. dynamic rope)
|
| 367 |
+
def forward(self, x, position_ids):
|
| 368 |
+
inv_freq_expanded = self.inv_freq[None, :, None].float().expand(position_ids.shape[0], -1, 1).to(x.device)
|
| 369 |
+
position_ids_expanded = position_ids[:, None, :].float()
|
| 370 |
+
|
| 371 |
+
device_type = x.device.type if isinstance(x.device.type, str) and x.device.type != "mps" else "cpu"
|
| 372 |
+
with torch.autocast(device_type=device_type, enabled=False): # Force float32
|
| 373 |
+
freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
|
| 374 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
| 375 |
+
cos = emb.cos() * self.attention_scaling
|
| 376 |
+
sin = emb.sin() * self.attention_scaling
|
| 377 |
+
|
| 378 |
+
return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
|
| 379 |
+
|
| 380 |
+
|
| 381 |
+
@auto_docstring
|
| 382 |
+
class EngGPTMoePreTrainedModel(PreTrainedModel):
|
| 383 |
+
config: EngGPTMoeConfig
|
| 384 |
+
base_model_prefix = "model"
|
| 385 |
+
supports_gradient_checkpointing = True
|
| 386 |
+
_no_split_modules = ["EngGPTMoeDecoderLayer"]
|
| 387 |
+
_skip_keys_device_placement = ["past_key_values"]
|
| 388 |
+
_supports_flash_attn = True
|
| 389 |
+
_supports_sdpa = True
|
| 390 |
+
_supports_flex_attn = True
|
| 391 |
+
_can_compile_fullgraph = False # MoE models don't work with torch.compile (`torch.where(condition)` not supported)
|
| 392 |
+
_supports_attention_backend = True
|
| 393 |
+
_can_record_outputs = {
|
| 394 |
+
"router_logits": OutputRecorder(EngGPTMoeSparseMoeBlock, index=1),
|
| 395 |
+
"hidden_states": EngGPTMoeDecoderLayer,
|
| 396 |
+
"attentions": EngGPTMoeAttention,
|
| 397 |
+
}
|
| 398 |
+
|
| 399 |
+
|
| 400 |
+
@auto_docstring
|
| 401 |
+
class EngGPTMoeModel(EngGPTMoePreTrainedModel):
|
| 402 |
+
def __init__(self, config: EngGPTMoeConfig):
|
| 403 |
+
super().__init__(config)
|
| 404 |
+
self.padding_idx = config.pad_token_id
|
| 405 |
+
self.vocab_size = config.vocab_size
|
| 406 |
+
|
| 407 |
+
self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.padding_idx)
|
| 408 |
+
self.layers = nn.ModuleList(
|
| 409 |
+
[EngGPTMoeDecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
|
| 410 |
+
)
|
| 411 |
+
self.norm = EngGPTMoeRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
| 412 |
+
self.rotary_emb = EngGPTMoeRotaryEmbedding(config=config)
|
| 413 |
+
self.gradient_checkpointing = False
|
| 414 |
+
|
| 415 |
+
# Initialize weights and apply final processing
|
| 416 |
+
self.post_init()
|
| 417 |
+
|
| 418 |
+
@check_model_inputs
|
| 419 |
+
@auto_docstring
|
| 420 |
+
def forward(
|
| 421 |
+
self,
|
| 422 |
+
input_ids: Optional[torch.LongTensor] = None,
|
| 423 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 424 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 425 |
+
past_key_values: Optional[Cache] = None,
|
| 426 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
| 427 |
+
use_cache: Optional[bool] = None,
|
| 428 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 429 |
+
**kwargs: Unpack[TransformersKwargs],
|
| 430 |
+
) -> MoeModelOutputWithPast:
|
| 431 |
+
if (input_ids is None) ^ (inputs_embeds is not None):
|
| 432 |
+
raise ValueError("You must specify exactly one of input_ids or inputs_embeds")
|
| 433 |
+
|
| 434 |
+
if use_cache and past_key_values is None:
|
| 435 |
+
past_key_values = DynamicCache(config=self.config)
|
| 436 |
+
|
| 437 |
+
if inputs_embeds is None:
|
| 438 |
+
inputs_embeds = self.embed_tokens(input_ids)
|
| 439 |
+
|
| 440 |
+
if cache_position is None:
|
| 441 |
+
past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0
|
| 442 |
+
cache_position = torch.arange(
|
| 443 |
+
past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
|
| 444 |
+
)
|
| 445 |
+
if position_ids is None:
|
| 446 |
+
position_ids = cache_position.unsqueeze(0)
|
| 447 |
+
|
| 448 |
+
mask_function = create_causal_mask if self.config.sliding_window is None else create_sliding_window_causal_mask
|
| 449 |
+
causal_mask = mask_function(
|
| 450 |
+
config=self.config,
|
| 451 |
+
input_embeds=inputs_embeds,
|
| 452 |
+
attention_mask=attention_mask,
|
| 453 |
+
cache_position=cache_position,
|
| 454 |
+
past_key_values=past_key_values,
|
| 455 |
+
position_ids=position_ids,
|
| 456 |
+
)
|
| 457 |
+
|
| 458 |
+
hidden_states = inputs_embeds
|
| 459 |
+
|
| 460 |
+
# create position embeddings to be shared across the decoder layers
|
| 461 |
+
position_embeddings = self.rotary_emb(hidden_states, position_ids)
|
| 462 |
+
|
| 463 |
+
for decoder_layer in self.layers[: self.config.num_hidden_layers]:
|
| 464 |
+
hidden_states = decoder_layer(
|
| 465 |
+
hidden_states,
|
| 466 |
+
position_embeddings=position_embeddings,
|
| 467 |
+
attention_mask=causal_mask,
|
| 468 |
+
position_ids=position_ids,
|
| 469 |
+
past_key_values=past_key_values,
|
| 470 |
+
use_cache=use_cache,
|
| 471 |
+
cache_position=cache_position,
|
| 472 |
+
**kwargs,
|
| 473 |
+
)
|
| 474 |
+
|
| 475 |
+
hidden_states = self.norm(hidden_states)
|
| 476 |
+
|
| 477 |
+
return MoeModelOutputWithPast( # only diff with Mistral is the output type, we need MoE
|
| 478 |
+
last_hidden_state=hidden_states,
|
| 479 |
+
past_key_values=past_key_values,
|
| 480 |
+
)
|
| 481 |
+
|
| 482 |
+
|
| 483 |
+
def load_balancing_loss_func(
|
| 484 |
+
gate_logits: Union[torch.Tensor, tuple[torch.Tensor], None],
|
| 485 |
+
num_experts: Optional[int] = None,
|
| 486 |
+
top_k=2,
|
| 487 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 488 |
+
) -> Union[torch.Tensor, int]:
|
| 489 |
+
r"""
|
| 490 |
+
Computes auxiliary load balancing loss as in Switch Transformer - implemented in Pytorch.
|
| 491 |
+
|
| 492 |
+
See Switch Transformer (https://huggingface.co/papers/2101.03961) for more details. This function implements the loss
|
| 493 |
+
function presented in equations (4) - (6) of the paper. It aims at penalizing cases where the routing between
|
| 494 |
+
experts is too unbalanced.
|
| 495 |
+
|
| 496 |
+
Args:
|
| 497 |
+
gate_logits:
|
| 498 |
+
Logits from the `gate`, should be a tuple of model.config.num_hidden_layers tensors of
|
| 499 |
+
shape [batch_size X sequence_length, num_experts].
|
| 500 |
+
num_experts:
|
| 501 |
+
Number of experts
|
| 502 |
+
top_k:
|
| 503 |
+
The number of experts to route per-token, can be also interpreted as the `top-k` routing
|
| 504 |
+
parameter.
|
| 505 |
+
attention_mask (`torch.Tensor`, *optional*):
|
| 506 |
+
The attention_mask used in forward function
|
| 507 |
+
shape [batch_size X sequence_length] if not None.
|
| 508 |
+
|
| 509 |
+
Returns:
|
| 510 |
+
The auxiliary loss.
|
| 511 |
+
"""
|
| 512 |
+
if gate_logits is None or not isinstance(gate_logits, tuple):
|
| 513 |
+
return 0
|
| 514 |
+
|
| 515 |
+
if isinstance(gate_logits, tuple):
|
| 516 |
+
compute_device = gate_logits[0].device
|
| 517 |
+
concatenated_gate_logits = torch.cat([layer_gate.to(compute_device) for layer_gate in gate_logits], dim=0)
|
| 518 |
+
|
| 519 |
+
routing_weights = torch.nn.functional.softmax(concatenated_gate_logits, dim=-1)
|
| 520 |
+
|
| 521 |
+
_, selected_experts = torch.topk(routing_weights, top_k, dim=-1)
|
| 522 |
+
|
| 523 |
+
expert_mask = torch.nn.functional.one_hot(selected_experts, num_experts)
|
| 524 |
+
|
| 525 |
+
if attention_mask is None:
|
| 526 |
+
# Compute the percentage of tokens routed to each experts
|
| 527 |
+
tokens_per_expert = torch.mean(expert_mask.float(), dim=0)
|
| 528 |
+
|
| 529 |
+
# Compute the average probability of routing to these experts
|
| 530 |
+
router_prob_per_expert = torch.mean(routing_weights, dim=0)
|
| 531 |
+
else:
|
| 532 |
+
batch_size, sequence_length = attention_mask.shape
|
| 533 |
+
num_hidden_layers = concatenated_gate_logits.shape[0] // (batch_size * sequence_length)
|
| 534 |
+
|
| 535 |
+
# Compute the mask that masks all padding tokens as 0 with the same shape of expert_mask
|
| 536 |
+
expert_attention_mask = (
|
| 537 |
+
attention_mask[None, :, :, None, None]
|
| 538 |
+
.expand((num_hidden_layers, batch_size, sequence_length, top_k, num_experts))
|
| 539 |
+
.reshape(-1, top_k, num_experts)
|
| 540 |
+
.to(compute_device)
|
| 541 |
+
)
|
| 542 |
+
|
| 543 |
+
# Compute the percentage of tokens routed to each experts
|
| 544 |
+
tokens_per_expert = torch.sum(expert_mask.float() * expert_attention_mask, dim=0) / torch.sum(
|
| 545 |
+
expert_attention_mask, dim=0
|
| 546 |
+
)
|
| 547 |
+
|
| 548 |
+
# Compute the mask that masks all padding tokens as 0 with the same shape of tokens_per_expert
|
| 549 |
+
router_per_expert_attention_mask = (
|
| 550 |
+
attention_mask[None, :, :, None]
|
| 551 |
+
.expand((num_hidden_layers, batch_size, sequence_length, num_experts))
|
| 552 |
+
.reshape(-1, num_experts)
|
| 553 |
+
.to(compute_device)
|
| 554 |
+
)
|
| 555 |
+
|
| 556 |
+
# Compute the average probability of routing to these experts
|
| 557 |
+
router_prob_per_expert = torch.sum(routing_weights * router_per_expert_attention_mask, dim=0) / torch.sum(
|
| 558 |
+
router_per_expert_attention_mask, dim=0
|
| 559 |
+
)
|
| 560 |
+
|
| 561 |
+
overall_loss = torch.sum(tokens_per_expert * router_prob_per_expert.unsqueeze(0))
|
| 562 |
+
return overall_loss * num_experts
|
| 563 |
+
|
| 564 |
+
|
| 565 |
+
@auto_docstring
|
| 566 |
+
class EngGPTMoeForCausalLM(EngGPTMoePreTrainedModel, GenerationMixin):
|
| 567 |
+
_tied_weights_keys = ["lm_head.weight"]
|
| 568 |
+
_tp_plan = {"lm_head": "colwise_rep"}
|
| 569 |
+
_pp_plan = {"lm_head": (["hidden_states"], ["logits"])}
|
| 570 |
+
|
| 571 |
+
def __init__(self, config: EngGPTMoeConfig):
|
| 572 |
+
super().__init__(config)
|
| 573 |
+
self.model = EngGPTMoeModel(config)
|
| 574 |
+
self.vocab_size = config.vocab_size
|
| 575 |
+
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
| 576 |
+
self.router_aux_loss_coef = config.router_aux_loss_coef
|
| 577 |
+
self.num_experts = config.num_experts
|
| 578 |
+
self.num_experts_per_tok = config.num_experts_per_tok
|
| 579 |
+
|
| 580 |
+
# Initialize weights and apply final processing
|
| 581 |
+
self.post_init()
|
| 582 |
+
|
| 583 |
+
@can_return_tuple
|
| 584 |
+
@auto_docstring
|
| 585 |
+
def forward(
|
| 586 |
+
self,
|
| 587 |
+
input_ids: Optional[torch.LongTensor] = None,
|
| 588 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 589 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 590 |
+
past_key_values: Optional[Cache] = None,
|
| 591 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
| 592 |
+
labels: Optional[torch.LongTensor] = None,
|
| 593 |
+
use_cache: Optional[bool] = None,
|
| 594 |
+
output_router_logits: Optional[bool] = None,
|
| 595 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 596 |
+
logits_to_keep: Union[int, torch.Tensor] = 0,
|
| 597 |
+
**kwargs: Unpack[TransformersKwargs],
|
| 598 |
+
) -> MoeCausalLMOutputWithPast:
|
| 599 |
+
r"""
|
| 600 |
+
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
| 601 |
+
Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
|
| 602 |
+
config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
|
| 603 |
+
(masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
|
| 604 |
+
|
| 605 |
+
Example:
|
| 606 |
+
|
| 607 |
+
```python
|
| 608 |
+
>>> from transformers import AutoTokenizer, EngGPTMoeForCausalLM
|
| 609 |
+
|
| 610 |
+
>>> model = EngGPTMoeForCausalLM.from_pretrained("mistralai/EngGPTMoe-8x7B-v0.1")
|
| 611 |
+
>>> tokenizer = AutoTokenizer.from_pretrained("mistralai/EngGPTMoe-8x7B-v0.1")
|
| 612 |
+
|
| 613 |
+
>>> prompt = "Hey, are you conscious? Can you talk to me?"
|
| 614 |
+
>>> inputs = tokenizer(prompt, return_tensors="pt")
|
| 615 |
+
|
| 616 |
+
>>> # Generate
|
| 617 |
+
>>> generate_ids = model.generate(inputs.input_ids, max_length=30)
|
| 618 |
+
>>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
| 619 |
+
"Hey, are you conscious? Can you talk to me?\nI'm not conscious, but I can talk to you."
|
| 620 |
+
```"""
|
| 621 |
+
|
| 622 |
+
output_router_logits = (
|
| 623 |
+
output_router_logits if output_router_logits is not None else self.config.output_router_logits
|
| 624 |
+
)
|
| 625 |
+
|
| 626 |
+
outputs: MoeModelOutputWithPast = self.model(
|
| 627 |
+
input_ids=input_ids,
|
| 628 |
+
attention_mask=attention_mask,
|
| 629 |
+
position_ids=position_ids,
|
| 630 |
+
past_key_values=past_key_values,
|
| 631 |
+
inputs_embeds=inputs_embeds,
|
| 632 |
+
use_cache=use_cache,
|
| 633 |
+
output_router_logits=output_router_logits,
|
| 634 |
+
cache_position=cache_position,
|
| 635 |
+
**kwargs,
|
| 636 |
+
)
|
| 637 |
+
|
| 638 |
+
hidden_states = outputs.last_hidden_state
|
| 639 |
+
|
| 640 |
+
slice_indices = slice(-logits_to_keep, None) if isinstance(logits_to_keep, int) else logits_to_keep
|
| 641 |
+
logits = self.lm_head(hidden_states[:, slice_indices, :])
|
| 642 |
+
|
| 643 |
+
loss = None
|
| 644 |
+
if labels is not None:
|
| 645 |
+
loss = self.loss_function(logits, labels, self.vocab_size, **kwargs)
|
| 646 |
+
|
| 647 |
+
aux_loss = None
|
| 648 |
+
if output_router_logits:
|
| 649 |
+
aux_loss = load_balancing_loss_func(
|
| 650 |
+
outputs.router_logits,
|
| 651 |
+
self.num_experts,
|
| 652 |
+
self.num_experts_per_tok,
|
| 653 |
+
attention_mask,
|
| 654 |
+
)
|
| 655 |
+
if labels is not None:
|
| 656 |
+
loss += self.router_aux_loss_coef * aux_loss.to(loss.device)
|
| 657 |
+
|
| 658 |
+
return MoeCausalLMOutputWithPast(
|
| 659 |
+
loss=loss,
|
| 660 |
+
aux_loss=aux_loss,
|
| 661 |
+
logits=logits,
|
| 662 |
+
past_key_values=outputs.past_key_values,
|
| 663 |
+
hidden_states=outputs.hidden_states,
|
| 664 |
+
attentions=outputs.attentions,
|
| 665 |
+
router_logits=outputs.router_logits,
|
| 666 |
+
)
|
| 667 |
+
|
| 668 |
+
|
| 669 |
+
class EngGPTMoeForSequenceClassification(GenericForSequenceClassification, EngGPTMoePreTrainedModel):
|
| 670 |
+
pass
|
| 671 |
+
|
| 672 |
+
|
| 673 |
+
class EngGPTMoeForTokenClassification(GenericForTokenClassification, EngGPTMoePreTrainedModel):
|
| 674 |
+
pass
|
| 675 |
+
|
| 676 |
+
|
| 677 |
+
class EngGPTMoeForQuestionAnswering(GenericForQuestionAnswering, EngGPTMoePreTrainedModel):
|
| 678 |
+
base_model_prefix = "transformer" # For BC, where `transformer` was used instead of `model`
|
| 679 |
+
|
| 680 |
+
|
| 681 |
+
__all__ = [
|
| 682 |
+
"EngGPTMoeForCausalLM",
|
| 683 |
+
"EngGPTMoeForQuestionAnswering",
|
| 684 |
+
"EngGPTMoeModel",
|
| 685 |
+
"EngGPTMoePreTrainedModel",
|
| 686 |
+
"EngGPTMoeForSequenceClassification",
|
| 687 |
+
"EngGPTMoeForTokenClassification",
|
| 688 |
+
]
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b9f3a9950d12942d3f2c3207b9fd8716c8a0569dadfb828511070b16f5f69886
|
| 3 |
+
size 17080552
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<s>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"is_local": true,
|
| 8 |
+
"local_files_only": false,
|
| 9 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 10 |
+
"pad_token": "<|endoftext|>",
|
| 11 |
+
"tokenizer_class": "TokenizersBackend",
|
| 12 |
+
"unk_token": "<unk>"
|
| 13 |
+
}
|