tomkay commited on
Commit
a92f3ef
·
verified ·
1 Parent(s): d78f35e

Initial upload: MiniMax-M2.7 mixed-precision MLX (116 GB, 3.78 avg bits)

Browse files
.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,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: mlx
3
+ tags:
4
+ - mlx
5
+ - quantized
6
+ - mixed-precision
7
+ - minimax
8
+ - moe
9
+ license: other
10
+ license_name: minimax-open-model-license
11
+ base_model: MiniMaxAI/MiniMax-M2.7
12
+ base_model_relation: quantized
13
+ pipeline_tag: text-generation
14
+ language: en
15
+ ---
16
+
17
+ # MiniMax-M2.7 — 116 GB (MLX)
18
+
19
+ Mixed-precision MLX build of [MiniMaxAI/MiniMax-M2.7](https://huggingface.co/MiniMaxAI/MiniMax-M2.7), prepared by [baa.ai](https://baa.ai).
20
+
21
+ ## Metrics
22
+
23
+ | Metric | Value |
24
+ |---|---|
25
+ | **Size on disk** | **116 GB** (25 shards) |
26
+ | Average bits per weight | 3.78 |
27
+ | Group size | 64 |
28
+ | Framework | MLX (Apple Silicon) |
29
+ | **HumanEval pass@1** | **93.3%** (153 / 164) |
30
+
31
+ HumanEval was run with the recommended inference settings below over all 164 problems, 0 skipped. Full per-task results available on request.
32
+
33
+ ## Recommended inference settings
34
+
35
+ These are the sampler parameters used for the HumanEval run above and are a good default for reasoning / code tasks:
36
+
37
+ ```python
38
+ sampler_params = {
39
+ "temperature": 1.0,
40
+ "top_p": 0.95,
41
+ "top_k": 40,
42
+ "repetition_penalty": 1.1,
43
+ "max_tokens": 8192,
44
+ }
45
+ ```
46
+
47
+ ## Chat template — thinking mode
48
+
49
+ MiniMax-M2.7 uses a `<think>…</think>` reasoning block. **Important:** the base chat template injects `<think>\n` at the end of the prompt before generation, so the model's output begins *inside* the reasoning block with no opening tag. To recover the final answer, strip everything up to and including the first `</think>`:
50
+
51
+ ```python
52
+ def strip_thinking(text: str) -> str:
53
+ if "</think>" in text:
54
+ return text.split("</think>", 1)[1].strip()
55
+ return text.strip()
56
+ ```
57
+
58
+ Give the model enough token budget that it can finish reasoning and emit the `</think>` closing tag — we recommend at least 4096, and 8192 for harder problems.
59
+
60
+ ## Usage
61
+
62
+ ```python
63
+ from mlx_lm import load, generate
64
+ from mlx_lm.sample_utils import make_sampler, make_logits_processors
65
+
66
+ model, tokenizer = load("baa-ai/MiniMax-M2.7-RAM-116GB-MLX")
67
+
68
+ sampler = make_sampler(temp=1.0, top_p=0.95, top_k=40)
69
+ logits_processors = make_logits_processors(repetition_penalty=1.1)
70
+
71
+ prompt = tokenizer.apply_chat_template(
72
+ [{"role": "user", "content": "Write a Python function that reverses a string."}],
73
+ tokenize=False,
74
+ add_generation_prompt=True,
75
+ )
76
+
77
+ response = generate(
78
+ model,
79
+ tokenizer,
80
+ prompt=prompt,
81
+ max_tokens=8192,
82
+ sampler=sampler,
83
+ logits_processors=logits_processors,
84
+ )
85
+
86
+ if "</think>" in response:
87
+ response = response.split("</think>", 1)[1].strip()
88
+ print(response)
89
+ ```
90
+
91
+ ## Hardware
92
+
93
+ - Apple Silicon Mac with **~128 GB** unified memory recommended for comfortable inference.
94
+ - Runs on less with swap, at substantially reduced throughput.
95
+
96
+ ---
97
+ *Quantized by [baa.ai](https://baa.ai)*
added_tokens.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "</minimax:tool_call>": 200053,
3
+ "</think>": 200051,
4
+ "<add_file>": 200036,
5
+ "<code_context>": 200043,
6
+ "<code_interpreter>": 200023,
7
+ "<commit_after>": 200018,
8
+ "<commit_before>": 200016,
9
+ "<commit_message>": 200040,
10
+ "<commit_msg>": 200017,
11
+ "<delete_file>": 200037,
12
+ "<edit_file>": 200039,
13
+ "<empty_output>": 200015,
14
+ "<empty_source_file>": 200041,
15
+ "<file_content>": 200044,
16
+ "<file_sep>": 200049,
17
+ "<filename>": 200006,
18
+ "<filepath>": 200048,
19
+ "<fim_middle>": 200002,
20
+ "<fim_pad>": 200004,
21
+ "<fim_prefix>": 200001,
22
+ "<fim_suffix>": 200003,
23
+ "<function_call>": 200022,
24
+ "<gh_stars>": 200007,
25
+ "<issue_closed>": 200010,
26
+ "<issue_comment>": 200009,
27
+ "<issue_start>": 200008,
28
+ "<jupyter_code>": 200013,
29
+ "<jupyter_error>": 200035,
30
+ "<jupyter_output>": 200014,
31
+ "<jupyter_start>": 200011,
32
+ "<jupyter_text>": 200012,
33
+ "<minimax:tool_call>": 200052,
34
+ "<pr_start>": 200046,
35
+ "<rename_file>": 200038,
36
+ "<repo_struct>": 200042,
37
+ "<reponame>": 200005,
38
+ "<review_comment>": 200047,
39
+ "<source_files>": 200045,
40
+ "<think>": 200050,
41
+ "[e~[": 200020,
42
+ "]!d~[": 200021,
43
+ "]!p~[": 200000,
44
+ "]<]end of image[>[": 200030,
45
+ "]<]end of speech[>[": 200028,
46
+ "]<]end of video[>[": 200032,
47
+ "]<]image[>[": 200025,
48
+ "]<]speech[>[": 200024,
49
+ "]<]start of image[>[": 200029,
50
+ "]<]start of speech[>[": 200027,
51
+ "]<]start of video[>[": 200031,
52
+ "]<]video[>[": 200026,
53
+ "]<]vision pad[>[": 200033,
54
+ "]~!b[": 200034,
55
+ "]~b]": 200019
56
+ }
chat_template.jinja ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {# ----------‑‑‑ special token variables ‑‑‑---------- #}
2
+ {%- set toolcall_begin_token = '<minimax:tool_call>' -%}
3
+ {%- set toolcall_end_token = '</minimax:tool_call>' -%}
4
+ {#- Tool Rendering Functions ============================================== -#}
5
+ {%- macro render_tool_namespace(namespace_name, tool_list) -%}
6
+ {%- for tool in tool_list -%}
7
+ <tool>{{ tool.function | tojson(ensure_ascii=False) }}</tool>
8
+ {% endfor -%}
9
+ {%- endmacro -%}
10
+ {%- macro visible_text(content) -%}
11
+ {%- if content is string -%}
12
+ {{ content }}
13
+ {%- elif content is iterable and content is not mapping -%}
14
+ {%- for item in content -%}
15
+ {%- if item is mapping and item.type == 'text' -%}
16
+ {{- item.text }}
17
+ {%- elif item is string -%}
18
+ {{- item }}
19
+ {%- endif -%}
20
+ {%- endfor -%}
21
+ {%- else -%}
22
+ {{- content }}
23
+ {%- endif -%}
24
+ {%- endmacro -%}
25
+ {#- System Message Construction ============================================ -#}
26
+ {%- macro build_system_message(system_message) -%}
27
+ {%- if system_message and system_message.content -%}
28
+ {{- visible_text(system_message.content) }}
29
+ {%- else -%}
30
+ {%- if model_identity is not defined -%}
31
+ {%- set model_identity = "You are a helpful assistant. Your name is MiniMax-M2.7 and is built by MiniMax." -%}
32
+ {%- endif -%}
33
+ {{- model_identity }}
34
+ {%- endif -%}
35
+
36
+ {#- Handle current_date -#}
37
+ {%- if system_message and system_message.current_date -%}
38
+ {{- '\n' ~ 'Current date: ' + system_message.current_date }}
39
+ {%- endif -%}
40
+ {#- Handle current_location -#}
41
+ {%- if system_message and system_message.current_location -%}
42
+ {{- '\n' ~ 'Current location: ' + system_message.current_location }}
43
+ {%- endif -%}
44
+ {%- endmacro -%}
45
+ {#- Main Template Logic ================================================= -#}
46
+ {#- Extract system message (only first message if it's system) -#}
47
+ {%- set system_message = none -%}
48
+ {%- set conversation_messages = messages -%}
49
+ {%- if messages and messages[0].role == "system" -%}
50
+ {%- set system_message = messages[0] -%}
51
+ {%- set conversation_messages = messages[1:] -%}
52
+ {%- endif -%}
53
+ {#- Get the last user message turn, for interleved thinking -#}
54
+ {%- set ns = namespace(last_user_index=-1) %}
55
+ {% for m in conversation_messages %}
56
+ {%- if m.role == 'user' %}
57
+ {% set ns.last_user_index = loop.index0 -%}
58
+ {%- endif %}
59
+ {%- endfor %}
60
+ {#- Render system message -#}
61
+ {{- ']~!b[' ~ ']~b]system' ~ '\n' }}
62
+ {{- build_system_message(system_message) }}
63
+ {#- Render tools if available -#}
64
+ {%- if tools -%}
65
+ {{- '\n\n' ~ '# Tools' ~ '\n' ~ 'You may call one or more tools to assist with the user query.\nHere are the tools available in JSONSchema format:' ~ '\n' }}
66
+ {{- '\n' ~ '<tools>' ~ '\n' }}
67
+ {{- render_tool_namespace("functions", tools) }}
68
+ {{- '</tools>' ~ '\n\n' }}
69
+ {{- 'When making tool calls, use XML format to invoke tools and pass parameters:' ~ '\n' }}
70
+ {{- '\n' ~ toolcall_begin_token }}
71
+ <invoke name="tool-name-1">
72
+ <parameter name="param-key-1">param-value-1</parameter>
73
+ <parameter name="param-key-2">param-value-2</parameter>
74
+ ...
75
+ </invoke>
76
+ {{- '\n' ~ toolcall_end_token }}
77
+ {%- endif -%}
78
+ {{- '[e~[\n' }}
79
+
80
+ {#- Render messages -#}
81
+ {%- set last_tool_call = namespace(name=none) -%}
82
+ {%- for message in conversation_messages -%}
83
+ {%- if message.role == 'assistant' -%}
84
+ {#- Only render reasoning_content if no user message follows -#}
85
+ {{- ']~b]ai' ~ '\n' }}
86
+
87
+ {%- set reasoning_content = '' %}
88
+ {%- set content = visible_text(message.content) %}
89
+ {%- if message.reasoning_content is string %}
90
+ {%- set reasoning_content = message.reasoning_content %}
91
+ {%- else %}
92
+ {%- if '</think>' in content %}
93
+ {%- set reasoning_content = content.split('</think>')[0].strip('\n').split('<think>')[-1].strip('\n') %}
94
+ {%- set content = content.split('</think>')[-1].strip('\n') %}
95
+ {%- endif %}
96
+ {%- endif %}
97
+ {%- if reasoning_content and loop.index0 > ns.last_user_index -%}
98
+ {{- '<think>' ~ '\n' ~ reasoning_content ~ '\n' ~ '</think>' ~ '\n\n' }}
99
+ {%- endif -%}
100
+ {%- if content -%}
101
+ {{- content }}
102
+ {%- endif -%}
103
+ {%- if message.tool_calls -%}
104
+ {{- '\n' ~ toolcall_begin_token ~ '\n' }}
105
+
106
+ {%- for tool_call in message.tool_calls -%}
107
+ {%- if tool_call.function %}
108
+ {%- set tool_call = tool_call.function %}
109
+ {%- endif %}
110
+ {{- '<invoke name="' + tool_call.name + '">' }}
111
+ {% set _args = tool_call.arguments %}
112
+ {%- for k, v in _args.items() %}
113
+ {{- '<parameter name="' + k + '">' }}
114
+ {{- v | tojson(ensure_ascii=False) if v is not string else v }}
115
+ {{- '</parameter>' }}
116
+ {% endfor %}
117
+ {{- '</invoke>' ~ '\n' }}
118
+ {%- endfor -%}
119
+
120
+ {{- toolcall_end_token}}
121
+ {%- set last_tool_call.name = message.tool_calls[-1].name -%}
122
+ {%- else -%}
123
+ {%- set last_tool_call.name = none -%}
124
+ {%- endif -%}
125
+ {{- '[e~[' ~ '\n' }}
126
+
127
+ {%- elif message.role == 'tool' -%}
128
+ {%- if last_tool_call.name is none -%}
129
+ {{- raise_exception("Message has tool role, but there was no previous assistant message with a tool call!") }}
130
+ {%- endif -%}
131
+ {%- if loop.first or (conversation_messages[loop.index0 - 1].role != 'tool') -%}
132
+ {{- ']~b]tool' }}
133
+ {%- endif -%}
134
+ {%- if message.content is string -%}
135
+ {{- '\n<response>' }}
136
+ {{- message.content }}
137
+ {{- '</response>' }}
138
+ {%- else -%}
139
+ {%- for tr in message.content -%}
140
+ {{- '\n<response>' }}
141
+ {{- tr.output if tr.output is defined else (tr.text if tr.type == 'text' and tr.text is defined else tr) }}
142
+ {{- '\n</response>' }}
143
+ {%- endfor -%}
144
+ {%- endif -%}
145
+ {%- if loop.last or (conversation_messages[loop.index0 + 1].role != 'tool') -%}
146
+ {{- '[e~[\n' -}}
147
+ {%- endif -%}
148
+
149
+ {%- elif message.role == 'user' -%}
150
+ {{- ']~b]user' ~ '\n' }}
151
+ {{- visible_text(message.content) }}
152
+ {{- '[e~[' ~ '\n' }}
153
+ {%- endif -%}
154
+ {%- endfor -%}
155
+
156
+ {#- Generation prompt -#}
157
+ {%- if add_generation_prompt -%}
158
+ {{- ']~b]ai' ~ '\n' ~ '<think>' ~ '\n' }}
159
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,3191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MiniMaxM2ForCausalLM"
4
+ ],
5
+ "attn_type_list": [
6
+ 1,
7
+ 1,
8
+ 1,
9
+ 1,
10
+ 1,
11
+ 1,
12
+ 1,
13
+ 1,
14
+ 1,
15
+ 1,
16
+ 1,
17
+ 1,
18
+ 1,
19
+ 1,
20
+ 1,
21
+ 1,
22
+ 1,
23
+ 1,
24
+ 1,
25
+ 1,
26
+ 1,
27
+ 1,
28
+ 1,
29
+ 1,
30
+ 1,
31
+ 1,
32
+ 1,
33
+ 1,
34
+ 1,
35
+ 1,
36
+ 1,
37
+ 1,
38
+ 1,
39
+ 1,
40
+ 1,
41
+ 1,
42
+ 1,
43
+ 1,
44
+ 1,
45
+ 1,
46
+ 1,
47
+ 1,
48
+ 1,
49
+ 1,
50
+ 1,
51
+ 1,
52
+ 1,
53
+ 1,
54
+ 1,
55
+ 1,
56
+ 1,
57
+ 1,
58
+ 1,
59
+ 1,
60
+ 1,
61
+ 1,
62
+ 1,
63
+ 1,
64
+ 1,
65
+ 1,
66
+ 1,
67
+ 1
68
+ ],
69
+ "auto_map": {
70
+ "AutoConfig": "configuration_minimax_m2.MiniMaxM2Config",
71
+ "AutoModelForCausalLM": "modeling_minimax_m2.MiniMaxM2ForCausalLM"
72
+ },
73
+ "dtype": "bfloat16",
74
+ "eos_token_id": 200020,
75
+ "head_dim": 128,
76
+ "hidden_act": "silu",
77
+ "hidden_size": 3072,
78
+ "intermediate_size": 1536,
79
+ "max_position_embeddings": 196608,
80
+ "model_type": "minimax_m2",
81
+ "mtp_transformer_layers": 1,
82
+ "num_attention_heads": 48,
83
+ "num_experts_per_tok": 8,
84
+ "num_hidden_layers": 62,
85
+ "num_key_value_heads": 8,
86
+ "num_local_experts": 256,
87
+ "num_mtp_modules": 3,
88
+ "qk_norm_type": "per_layer",
89
+ "quantization": {
90
+ "group_size": 64,
91
+ "bits": 4,
92
+ "mode": "affine",
93
+ "model.layers.0.self_attn.q_proj": {
94
+ "group_size": 64,
95
+ "bits": 6
96
+ },
97
+ "model.layers.0.self_attn.k_proj": {
98
+ "group_size": 64,
99
+ "bits": 8
100
+ },
101
+ "model.layers.0.self_attn.v_proj": {
102
+ "group_size": 64,
103
+ "bits": 8
104
+ },
105
+ "model.layers.0.self_attn.o_proj": {
106
+ "group_size": 64,
107
+ "bits": 8
108
+ },
109
+ "model.layers.0.block_sparse_moe.switch_mlp.gate_proj": {
110
+ "group_size": 64,
111
+ "bits": 4
112
+ },
113
+ "model.layers.0.block_sparse_moe.switch_mlp.up_proj": {
114
+ "group_size": 64,
115
+ "bits": 4
116
+ },
117
+ "model.layers.0.block_sparse_moe.switch_mlp.down_proj": {
118
+ "group_size": 64,
119
+ "bits": 4
120
+ },
121
+ "model.layers.1.self_attn.o_proj": {
122
+ "group_size": 64,
123
+ "bits": 8
124
+ },
125
+ "model.layers.1.block_sparse_moe.switch_mlp.gate_proj": {
126
+ "group_size": 64,
127
+ "bits": 4
128
+ },
129
+ "model.layers.1.block_sparse_moe.switch_mlp.up_proj": {
130
+ "group_size": 64,
131
+ "bits": 4
132
+ },
133
+ "model.layers.1.block_sparse_moe.switch_mlp.down_proj": {
134
+ "group_size": 64,
135
+ "bits": 4
136
+ },
137
+ "model.layers.2.self_attn.q_proj": {
138
+ "group_size": 64,
139
+ "bits": 4
140
+ },
141
+ "model.layers.2.self_attn.k_proj": {
142
+ "group_size": 64,
143
+ "bits": 8
144
+ },
145
+ "model.layers.2.self_attn.v_proj": {
146
+ "group_size": 64,
147
+ "bits": 8
148
+ },
149
+ "model.layers.2.self_attn.o_proj": {
150
+ "group_size": 64,
151
+ "bits": 5
152
+ },
153
+ "model.layers.2.block_sparse_moe.switch_mlp.gate_proj": {
154
+ "group_size": 64,
155
+ "bits": 3
156
+ },
157
+ "model.layers.2.block_sparse_moe.switch_mlp.up_proj": {
158
+ "group_size": 64,
159
+ "bits": 3
160
+ },
161
+ "model.layers.2.block_sparse_moe.switch_mlp.down_proj": {
162
+ "group_size": 64,
163
+ "bits": 4
164
+ },
165
+ "model.layers.3.self_attn.q_proj": {
166
+ "group_size": 64,
167
+ "bits": 5
168
+ },
169
+ "model.layers.3.self_attn.k_proj": {
170
+ "group_size": 64,
171
+ "bits": 5
172
+ },
173
+ "model.layers.3.self_attn.v_proj": {
174
+ "group_size": 64,
175
+ "bits": 8
176
+ },
177
+ "model.layers.3.self_attn.o_proj": {
178
+ "group_size": 64,
179
+ "bits": 5
180
+ },
181
+ "model.layers.3.block_sparse_moe.switch_mlp.gate_proj": {
182
+ "group_size": 64,
183
+ "bits": 4
184
+ },
185
+ "model.layers.3.block_sparse_moe.switch_mlp.up_proj": {
186
+ "group_size": 64,
187
+ "bits": 3
188
+ },
189
+ "model.layers.3.block_sparse_moe.switch_mlp.down_proj": {
190
+ "group_size": 64,
191
+ "bits": 4
192
+ },
193
+ "model.layers.4.self_attn.q_proj": {
194
+ "group_size": 64,
195
+ "bits": 5
196
+ },
197
+ "model.layers.4.self_attn.k_proj": {
198
+ "group_size": 64,
199
+ "bits": 6
200
+ },
201
+ "model.layers.4.self_attn.v_proj": {
202
+ "group_size": 64,
203
+ "bits": 8
204
+ },
205
+ "model.layers.4.self_attn.o_proj": {
206
+ "group_size": 64,
207
+ "bits": 5
208
+ },
209
+ "model.layers.4.block_sparse_moe.switch_mlp.gate_proj": {
210
+ "group_size": 64,
211
+ "bits": 3
212
+ },
213
+ "model.layers.4.block_sparse_moe.switch_mlp.up_proj": {
214
+ "group_size": 64,
215
+ "bits": 3
216
+ },
217
+ "model.layers.4.block_sparse_moe.switch_mlp.down_proj": {
218
+ "group_size": 64,
219
+ "bits": 3
220
+ },
221
+ "model.layers.5.self_attn.q_proj": {
222
+ "group_size": 64,
223
+ "bits": 5
224
+ },
225
+ "model.layers.5.self_attn.k_proj": {
226
+ "group_size": 64,
227
+ "bits": 8
228
+ },
229
+ "model.layers.5.self_attn.v_proj": {
230
+ "group_size": 64,
231
+ "bits": 8
232
+ },
233
+ "model.layers.5.self_attn.o_proj": {
234
+ "group_size": 64,
235
+ "bits": 5
236
+ },
237
+ "model.layers.5.block_sparse_moe.switch_mlp.gate_proj": {
238
+ "group_size": 64,
239
+ "bits": 3
240
+ },
241
+ "model.layers.5.block_sparse_moe.switch_mlp.up_proj": {
242
+ "group_size": 64,
243
+ "bits": 4
244
+ },
245
+ "model.layers.5.block_sparse_moe.switch_mlp.down_proj": {
246
+ "group_size": 64,
247
+ "bits": 4
248
+ },
249
+ "model.layers.6.self_attn.q_proj": {
250
+ "group_size": 64,
251
+ "bits": 3
252
+ },
253
+ "model.layers.6.self_attn.k_proj": {
254
+ "group_size": 64,
255
+ "bits": 4
256
+ },
257
+ "model.layers.6.self_attn.v_proj": {
258
+ "group_size": 64,
259
+ "bits": 6
260
+ },
261
+ "model.layers.6.self_attn.o_proj": {
262
+ "group_size": 64,
263
+ "bits": 4
264
+ },
265
+ "model.layers.6.block_sparse_moe.switch_mlp.gate_proj": {
266
+ "group_size": 64,
267
+ "bits": 4
268
+ },
269
+ "model.layers.6.block_sparse_moe.switch_mlp.up_proj": {
270
+ "group_size": 64,
271
+ "bits": 4
272
+ },
273
+ "model.layers.6.block_sparse_moe.switch_mlp.down_proj": {
274
+ "group_size": 64,
275
+ "bits": 3
276
+ },
277
+ "model.layers.7.self_attn.q_proj": {
278
+ "group_size": 64,
279
+ "bits": 4
280
+ },
281
+ "model.layers.7.self_attn.k_proj": {
282
+ "group_size": 64,
283
+ "bits": 5
284
+ },
285
+ "model.layers.7.self_attn.v_proj": {
286
+ "group_size": 64,
287
+ "bits": 6
288
+ },
289
+ "model.layers.7.self_attn.o_proj": {
290
+ "group_size": 64,
291
+ "bits": 4
292
+ },
293
+ "model.layers.7.block_sparse_moe.switch_mlp.gate_proj": {
294
+ "group_size": 64,
295
+ "bits": 3
296
+ },
297
+ "model.layers.7.block_sparse_moe.switch_mlp.up_proj": {
298
+ "group_size": 64,
299
+ "bits": 3
300
+ },
301
+ "model.layers.7.block_sparse_moe.switch_mlp.down_proj": {
302
+ "group_size": 64,
303
+ "bits": 3
304
+ },
305
+ "model.layers.8.self_attn.q_proj": {
306
+ "group_size": 64,
307
+ "bits": 3
308
+ },
309
+ "model.layers.8.self_attn.k_proj": {
310
+ "group_size": 64,
311
+ "bits": 5
312
+ },
313
+ "model.layers.8.self_attn.v_proj": {
314
+ "group_size": 64,
315
+ "bits": 5
316
+ },
317
+ "model.layers.8.self_attn.o_proj": {
318
+ "group_size": 64,
319
+ "bits": 4
320
+ },
321
+ "model.layers.8.block_sparse_moe.gate": {
322
+ "group_size": 64,
323
+ "bits": 8
324
+ },
325
+ "model.layers.8.block_sparse_moe.switch_mlp.gate_proj": {
326
+ "group_size": 64,
327
+ "bits": 4
328
+ },
329
+ "model.layers.8.block_sparse_moe.switch_mlp.up_proj": {
330
+ "group_size": 64,
331
+ "bits": 4
332
+ },
333
+ "model.layers.8.block_sparse_moe.switch_mlp.down_proj": {
334
+ "group_size": 64,
335
+ "bits": 3
336
+ },
337
+ "model.layers.9.self_attn.q_proj": {
338
+ "group_size": 64,
339
+ "bits": 3
340
+ },
341
+ "model.layers.9.self_attn.k_proj": {
342
+ "group_size": 64,
343
+ "bits": 4
344
+ },
345
+ "model.layers.9.self_attn.v_proj": {
346
+ "group_size": 64,
347
+ "bits": 6
348
+ },
349
+ "model.layers.9.self_attn.o_proj": {
350
+ "group_size": 64,
351
+ "bits": 4
352
+ },
353
+ "model.layers.9.block_sparse_moe.gate": {
354
+ "group_size": 64,
355
+ "bits": 8
356
+ },
357
+ "model.layers.9.block_sparse_moe.switch_mlp.gate_proj": {
358
+ "group_size": 64,
359
+ "bits": 4
360
+ },
361
+ "model.layers.9.block_sparse_moe.switch_mlp.up_proj": {
362
+ "group_size": 64,
363
+ "bits": 4
364
+ },
365
+ "model.layers.9.block_sparse_moe.switch_mlp.down_proj": {
366
+ "group_size": 64,
367
+ "bits": 4
368
+ },
369
+ "model.layers.10.self_attn.q_proj": {
370
+ "group_size": 64,
371
+ "bits": 3
372
+ },
373
+ "model.layers.10.self_attn.k_proj": {
374
+ "group_size": 64,
375
+ "bits": 4
376
+ },
377
+ "model.layers.10.self_attn.v_proj": {
378
+ "group_size": 64,
379
+ "bits": 5
380
+ },
381
+ "model.layers.10.self_attn.o_proj": {
382
+ "group_size": 64,
383
+ "bits": 3
384
+ },
385
+ "model.layers.10.block_sparse_moe.gate": {
386
+ "group_size": 64,
387
+ "bits": 8
388
+ },
389
+ "model.layers.10.block_sparse_moe.switch_mlp.gate_proj": {
390
+ "group_size": 64,
391
+ "bits": 4
392
+ },
393
+ "model.layers.10.block_sparse_moe.switch_mlp.up_proj": {
394
+ "group_size": 64,
395
+ "bits": 4
396
+ },
397
+ "model.layers.10.block_sparse_moe.switch_mlp.down_proj": {
398
+ "group_size": 64,
399
+ "bits": 3
400
+ },
401
+ "model.layers.11.self_attn.q_proj": {
402
+ "group_size": 64,
403
+ "bits": 4
404
+ },
405
+ "model.layers.11.self_attn.k_proj": {
406
+ "group_size": 64,
407
+ "bits": 6
408
+ },
409
+ "model.layers.11.self_attn.v_proj": {
410
+ "group_size": 64,
411
+ "bits": 6
412
+ },
413
+ "model.layers.11.self_attn.o_proj": {
414
+ "group_size": 64,
415
+ "bits": 4
416
+ },
417
+ "model.layers.11.block_sparse_moe.switch_mlp.gate_proj": {
418
+ "group_size": 64,
419
+ "bits": 4
420
+ },
421
+ "model.layers.11.block_sparse_moe.switch_mlp.up_proj": {
422
+ "group_size": 64,
423
+ "bits": 2
424
+ },
425
+ "model.layers.11.block_sparse_moe.switch_mlp.down_proj": {
426
+ "group_size": 64,
427
+ "bits": 4
428
+ },
429
+ "model.layers.12.self_attn.q_proj": {
430
+ "group_size": 64,
431
+ "bits": 3
432
+ },
433
+ "model.layers.12.self_attn.k_proj": {
434
+ "group_size": 64,
435
+ "bits": 5
436
+ },
437
+ "model.layers.12.self_attn.v_proj": {
438
+ "group_size": 64,
439
+ "bits": 6
440
+ },
441
+ "model.layers.12.self_attn.o_proj": {
442
+ "group_size": 64,
443
+ "bits": 4
444
+ },
445
+ "model.layers.12.block_sparse_moe.gate": {
446
+ "group_size": 64,
447
+ "bits": 8
448
+ },
449
+ "model.layers.12.block_sparse_moe.switch_mlp.gate_proj": {
450
+ "group_size": 64,
451
+ "bits": 4
452
+ },
453
+ "model.layers.12.block_sparse_moe.switch_mlp.up_proj": {
454
+ "group_size": 64,
455
+ "bits": 2
456
+ },
457
+ "model.layers.12.block_sparse_moe.switch_mlp.down_proj": {
458
+ "group_size": 64,
459
+ "bits": 4
460
+ },
461
+ "model.layers.13.self_attn.q_proj": {
462
+ "group_size": 64,
463
+ "bits": 3
464
+ },
465
+ "model.layers.13.self_attn.k_proj": {
466
+ "group_size": 64,
467
+ "bits": 4
468
+ },
469
+ "model.layers.13.self_attn.v_proj": {
470
+ "group_size": 64,
471
+ "bits": 6
472
+ },
473
+ "model.layers.13.self_attn.o_proj": {
474
+ "group_size": 64,
475
+ "bits": 4
476
+ },
477
+ "model.layers.13.block_sparse_moe.switch_mlp.gate_proj": {
478
+ "group_size": 64,
479
+ "bits": 4
480
+ },
481
+ "model.layers.13.block_sparse_moe.switch_mlp.up_proj": {
482
+ "group_size": 64,
483
+ "bits": 2
484
+ },
485
+ "model.layers.13.block_sparse_moe.switch_mlp.down_proj": {
486
+ "group_size": 64,
487
+ "bits": 4
488
+ },
489
+ "model.layers.14.self_attn.q_proj": {
490
+ "group_size": 64,
491
+ "bits": 3
492
+ },
493
+ "model.layers.14.self_attn.k_proj": {
494
+ "group_size": 64,
495
+ "bits": 5
496
+ },
497
+ "model.layers.14.self_attn.v_proj": {
498
+ "group_size": 64,
499
+ "bits": 6
500
+ },
501
+ "model.layers.14.self_attn.o_proj": {
502
+ "group_size": 64,
503
+ "bits": 4
504
+ },
505
+ "model.layers.14.block_sparse_moe.gate": {
506
+ "group_size": 64,
507
+ "bits": 8
508
+ },
509
+ "model.layers.14.block_sparse_moe.switch_mlp.gate_proj": {
510
+ "group_size": 64,
511
+ "bits": 4
512
+ },
513
+ "model.layers.14.block_sparse_moe.switch_mlp.up_proj": {
514
+ "group_size": 64,
515
+ "bits": 2
516
+ },
517
+ "model.layers.14.block_sparse_moe.switch_mlp.down_proj": {
518
+ "group_size": 64,
519
+ "bits": 2
520
+ },
521
+ "model.layers.15.self_attn.q_proj": {
522
+ "group_size": 64,
523
+ "bits": 3
524
+ },
525
+ "model.layers.15.self_attn.k_proj": {
526
+ "group_size": 64,
527
+ "bits": 5
528
+ },
529
+ "model.layers.15.self_attn.v_proj": {
530
+ "group_size": 64,
531
+ "bits": 6
532
+ },
533
+ "model.layers.15.self_attn.o_proj": {
534
+ "group_size": 64,
535
+ "bits": 4
536
+ },
537
+ "model.layers.15.block_sparse_moe.gate": {
538
+ "group_size": 64,
539
+ "bits": 8
540
+ },
541
+ "model.layers.15.block_sparse_moe.switch_mlp.gate_proj": {
542
+ "group_size": 64,
543
+ "bits": 2
544
+ },
545
+ "model.layers.15.block_sparse_moe.switch_mlp.up_proj": {
546
+ "group_size": 64,
547
+ "bits": 2
548
+ },
549
+ "model.layers.15.block_sparse_moe.switch_mlp.down_proj": {
550
+ "group_size": 64,
551
+ "bits": 2
552
+ },
553
+ "model.layers.16.self_attn.q_proj": {
554
+ "group_size": 64,
555
+ "bits": 4
556
+ },
557
+ "model.layers.16.self_attn.k_proj": {
558
+ "group_size": 64,
559
+ "bits": 5
560
+ },
561
+ "model.layers.16.self_attn.v_proj": {
562
+ "group_size": 64,
563
+ "bits": 6
564
+ },
565
+ "model.layers.16.self_attn.o_proj": {
566
+ "group_size": 64,
567
+ "bits": 4
568
+ },
569
+ "model.layers.16.block_sparse_moe.gate": {
570
+ "group_size": 64,
571
+ "bits": 8
572
+ },
573
+ "model.layers.16.block_sparse_moe.switch_mlp.gate_proj": {
574
+ "group_size": 64,
575
+ "bits": 2
576
+ },
577
+ "model.layers.16.block_sparse_moe.switch_mlp.up_proj": {
578
+ "group_size": 64,
579
+ "bits": 2
580
+ },
581
+ "model.layers.16.block_sparse_moe.switch_mlp.down_proj": {
582
+ "group_size": 64,
583
+ "bits": 2
584
+ },
585
+ "model.layers.17.self_attn.q_proj": {
586
+ "group_size": 64,
587
+ "bits": 3
588
+ },
589
+ "model.layers.17.self_attn.k_proj": {
590
+ "group_size": 64,
591
+ "bits": 5
592
+ },
593
+ "model.layers.17.self_attn.v_proj": {
594
+ "group_size": 64,
595
+ "bits": 6
596
+ },
597
+ "model.layers.17.self_attn.o_proj": {
598
+ "group_size": 64,
599
+ "bits": 4
600
+ },
601
+ "model.layers.17.block_sparse_moe.gate": {
602
+ "group_size": 64,
603
+ "bits": 8
604
+ },
605
+ "model.layers.17.block_sparse_moe.switch_mlp.gate_proj": {
606
+ "group_size": 64,
607
+ "bits": 2
608
+ },
609
+ "model.layers.17.block_sparse_moe.switch_mlp.up_proj": {
610
+ "group_size": 64,
611
+ "bits": 2
612
+ },
613
+ "model.layers.17.block_sparse_moe.switch_mlp.down_proj": {
614
+ "group_size": 64,
615
+ "bits": 2
616
+ },
617
+ "model.layers.18.self_attn.q_proj": {
618
+ "group_size": 64,
619
+ "bits": 4
620
+ },
621
+ "model.layers.18.self_attn.k_proj": {
622
+ "group_size": 64,
623
+ "bits": 5
624
+ },
625
+ "model.layers.18.self_attn.v_proj": {
626
+ "group_size": 64,
627
+ "bits": 6
628
+ },
629
+ "model.layers.18.self_attn.o_proj": {
630
+ "group_size": 64,
631
+ "bits": 4
632
+ },
633
+ "model.layers.18.block_sparse_moe.gate": {
634
+ "group_size": 64,
635
+ "bits": 8
636
+ },
637
+ "model.layers.18.block_sparse_moe.switch_mlp.gate_proj": {
638
+ "group_size": 64,
639
+ "bits": 2
640
+ },
641
+ "model.layers.18.block_sparse_moe.switch_mlp.up_proj": {
642
+ "group_size": 64,
643
+ "bits": 2
644
+ },
645
+ "model.layers.18.block_sparse_moe.switch_mlp.down_proj": {
646
+ "group_size": 64,
647
+ "bits": 2
648
+ },
649
+ "model.layers.19.self_attn.q_proj": {
650
+ "group_size": 64,
651
+ "bits": 3
652
+ },
653
+ "model.layers.19.self_attn.k_proj": {
654
+ "group_size": 64,
655
+ "bits": 5
656
+ },
657
+ "model.layers.19.self_attn.v_proj": {
658
+ "group_size": 64,
659
+ "bits": 6
660
+ },
661
+ "model.layers.19.self_attn.o_proj": {
662
+ "group_size": 64,
663
+ "bits": 4
664
+ },
665
+ "model.layers.19.block_sparse_moe.gate": {
666
+ "group_size": 64,
667
+ "bits": 8
668
+ },
669
+ "model.layers.19.block_sparse_moe.switch_mlp.gate_proj": {
670
+ "group_size": 64,
671
+ "bits": 2
672
+ },
673
+ "model.layers.19.block_sparse_moe.switch_mlp.up_proj": {
674
+ "group_size": 64,
675
+ "bits": 2
676
+ },
677
+ "model.layers.19.block_sparse_moe.switch_mlp.down_proj": {
678
+ "group_size": 64,
679
+ "bits": 2
680
+ },
681
+ "model.layers.20.self_attn.q_proj": {
682
+ "group_size": 64,
683
+ "bits": 3
684
+ },
685
+ "model.layers.20.self_attn.k_proj": {
686
+ "group_size": 64,
687
+ "bits": 5
688
+ },
689
+ "model.layers.20.self_attn.v_proj": {
690
+ "group_size": 64,
691
+ "bits": 6
692
+ },
693
+ "model.layers.20.self_attn.o_proj": {
694
+ "group_size": 64,
695
+ "bits": 4
696
+ },
697
+ "model.layers.20.block_sparse_moe.switch_mlp.gate_proj": {
698
+ "group_size": 64,
699
+ "bits": 2
700
+ },
701
+ "model.layers.20.block_sparse_moe.switch_mlp.up_proj": {
702
+ "group_size": 64,
703
+ "bits": 2
704
+ },
705
+ "model.layers.20.block_sparse_moe.switch_mlp.down_proj": {
706
+ "group_size": 64,
707
+ "bits": 2
708
+ },
709
+ "model.layers.21.self_attn.q_proj": {
710
+ "group_size": 64,
711
+ "bits": 3
712
+ },
713
+ "model.layers.21.self_attn.k_proj": {
714
+ "group_size": 64,
715
+ "bits": 4
716
+ },
717
+ "model.layers.21.self_attn.v_proj": {
718
+ "group_size": 64,
719
+ "bits": 6
720
+ },
721
+ "model.layers.21.self_attn.o_proj": {
722
+ "group_size": 64,
723
+ "bits": 4
724
+ },
725
+ "model.layers.21.block_sparse_moe.gate": {
726
+ "group_size": 64,
727
+ "bits": 8
728
+ },
729
+ "model.layers.21.block_sparse_moe.switch_mlp.gate_proj": {
730
+ "group_size": 64,
731
+ "bits": 2
732
+ },
733
+ "model.layers.21.block_sparse_moe.switch_mlp.up_proj": {
734
+ "group_size": 64,
735
+ "bits": 2
736
+ },
737
+ "model.layers.21.block_sparse_moe.switch_mlp.down_proj": {
738
+ "group_size": 64,
739
+ "bits": 2
740
+ },
741
+ "model.layers.22.self_attn.q_proj": {
742
+ "group_size": 64,
743
+ "bits": 3
744
+ },
745
+ "model.layers.22.self_attn.k_proj": {
746
+ "group_size": 64,
747
+ "bits": 5
748
+ },
749
+ "model.layers.22.self_attn.v_proj": {
750
+ "group_size": 64,
751
+ "bits": 6
752
+ },
753
+ "model.layers.22.self_attn.o_proj": {
754
+ "group_size": 64,
755
+ "bits": 4
756
+ },
757
+ "model.layers.22.block_sparse_moe.gate": {
758
+ "group_size": 64,
759
+ "bits": 8
760
+ },
761
+ "model.layers.22.block_sparse_moe.switch_mlp.gate_proj": {
762
+ "group_size": 64,
763
+ "bits": 2
764
+ },
765
+ "model.layers.22.block_sparse_moe.switch_mlp.up_proj": {
766
+ "group_size": 64,
767
+ "bits": 2
768
+ },
769
+ "model.layers.22.block_sparse_moe.switch_mlp.down_proj": {
770
+ "group_size": 64,
771
+ "bits": 2
772
+ },
773
+ "model.layers.23.self_attn.q_proj": {
774
+ "group_size": 64,
775
+ "bits": 4
776
+ },
777
+ "model.layers.23.self_attn.k_proj": {
778
+ "group_size": 64,
779
+ "bits": 5
780
+ },
781
+ "model.layers.23.self_attn.v_proj": {
782
+ "group_size": 64,
783
+ "bits": 8
784
+ },
785
+ "model.layers.23.self_attn.o_proj": {
786
+ "group_size": 64,
787
+ "bits": 4
788
+ },
789
+ "model.layers.23.block_sparse_moe.gate": {
790
+ "group_size": 64,
791
+ "bits": 8
792
+ },
793
+ "model.layers.23.block_sparse_moe.switch_mlp.gate_proj": {
794
+ "group_size": 64,
795
+ "bits": 2
796
+ },
797
+ "model.layers.23.block_sparse_moe.switch_mlp.up_proj": {
798
+ "group_size": 64,
799
+ "bits": 2
800
+ },
801
+ "model.layers.23.block_sparse_moe.switch_mlp.down_proj": {
802
+ "group_size": 64,
803
+ "bits": 4
804
+ },
805
+ "model.layers.24.self_attn.q_proj": {
806
+ "group_size": 64,
807
+ "bits": 4
808
+ },
809
+ "model.layers.24.self_attn.k_proj": {
810
+ "group_size": 64,
811
+ "bits": 6
812
+ },
813
+ "model.layers.24.self_attn.v_proj": {
814
+ "group_size": 64,
815
+ "bits": 6
816
+ },
817
+ "model.layers.24.self_attn.o_proj": {
818
+ "group_size": 64,
819
+ "bits": 5
820
+ },
821
+ "model.layers.24.block_sparse_moe.switch_mlp.gate_proj": {
822
+ "group_size": 64,
823
+ "bits": 4
824
+ },
825
+ "model.layers.24.block_sparse_moe.switch_mlp.up_proj": {
826
+ "group_size": 64,
827
+ "bits": 2
828
+ },
829
+ "model.layers.24.block_sparse_moe.switch_mlp.down_proj": {
830
+ "group_size": 64,
831
+ "bits": 4
832
+ },
833
+ "model.layers.25.self_attn.q_proj": {
834
+ "group_size": 64,
835
+ "bits": 4
836
+ },
837
+ "model.layers.25.self_attn.k_proj": {
838
+ "group_size": 64,
839
+ "bits": 5
840
+ },
841
+ "model.layers.25.self_attn.v_proj": {
842
+ "group_size": 64,
843
+ "bits": 6
844
+ },
845
+ "model.layers.25.self_attn.o_proj": {
846
+ "group_size": 64,
847
+ "bits": 5
848
+ },
849
+ "model.layers.25.block_sparse_moe.gate": {
850
+ "group_size": 64,
851
+ "bits": 8
852
+ },
853
+ "model.layers.25.block_sparse_moe.switch_mlp.gate_proj": {
854
+ "group_size": 64,
855
+ "bits": 2
856
+ },
857
+ "model.layers.25.block_sparse_moe.switch_mlp.up_proj": {
858
+ "group_size": 64,
859
+ "bits": 2
860
+ },
861
+ "model.layers.25.block_sparse_moe.switch_mlp.down_proj": {
862
+ "group_size": 64,
863
+ "bits": 2
864
+ },
865
+ "model.layers.26.self_attn.q_proj": {
866
+ "group_size": 64,
867
+ "bits": 4
868
+ },
869
+ "model.layers.26.self_attn.k_proj": {
870
+ "group_size": 64,
871
+ "bits": 5
872
+ },
873
+ "model.layers.26.self_attn.v_proj": {
874
+ "group_size": 64,
875
+ "bits": 6
876
+ },
877
+ "model.layers.26.self_attn.o_proj": {
878
+ "group_size": 64,
879
+ "bits": 5
880
+ },
881
+ "model.layers.26.block_sparse_moe.gate": {
882
+ "group_size": 64,
883
+ "bits": 8
884
+ },
885
+ "model.layers.26.block_sparse_moe.switch_mlp.gate_proj": {
886
+ "group_size": 64,
887
+ "bits": 2
888
+ },
889
+ "model.layers.26.block_sparse_moe.switch_mlp.up_proj": {
890
+ "group_size": 64,
891
+ "bits": 2
892
+ },
893
+ "model.layers.26.block_sparse_moe.switch_mlp.down_proj": {
894
+ "group_size": 64,
895
+ "bits": 2
896
+ },
897
+ "model.layers.27.self_attn.q_proj": {
898
+ "group_size": 64,
899
+ "bits": 4
900
+ },
901
+ "model.layers.27.self_attn.k_proj": {
902
+ "group_size": 64,
903
+ "bits": 5
904
+ },
905
+ "model.layers.27.self_attn.v_proj": {
906
+ "group_size": 64,
907
+ "bits": 8
908
+ },
909
+ "model.layers.27.self_attn.o_proj": {
910
+ "group_size": 64,
911
+ "bits": 5
912
+ },
913
+ "model.layers.27.block_sparse_moe.gate": {
914
+ "group_size": 64,
915
+ "bits": 8
916
+ },
917
+ "model.layers.27.block_sparse_moe.switch_mlp.gate_proj": {
918
+ "group_size": 64,
919
+ "bits": 2
920
+ },
921
+ "model.layers.27.block_sparse_moe.switch_mlp.up_proj": {
922
+ "group_size": 64,
923
+ "bits": 2
924
+ },
925
+ "model.layers.27.block_sparse_moe.switch_mlp.down_proj": {
926
+ "group_size": 64,
927
+ "bits": 2
928
+ },
929
+ "model.layers.28.self_attn.q_proj": {
930
+ "group_size": 64,
931
+ "bits": 4
932
+ },
933
+ "model.layers.28.self_attn.k_proj": {
934
+ "group_size": 64,
935
+ "bits": 6
936
+ },
937
+ "model.layers.28.self_attn.v_proj": {
938
+ "group_size": 64,
939
+ "bits": 6
940
+ },
941
+ "model.layers.28.self_attn.o_proj": {
942
+ "group_size": 64,
943
+ "bits": 5
944
+ },
945
+ "model.layers.28.block_sparse_moe.gate": {
946
+ "group_size": 64,
947
+ "bits": 8
948
+ },
949
+ "model.layers.28.block_sparse_moe.switch_mlp.gate_proj": {
950
+ "group_size": 64,
951
+ "bits": 2
952
+ },
953
+ "model.layers.28.block_sparse_moe.switch_mlp.up_proj": {
954
+ "group_size": 64,
955
+ "bits": 2
956
+ },
957
+ "model.layers.28.block_sparse_moe.switch_mlp.down_proj": {
958
+ "group_size": 64,
959
+ "bits": 4
960
+ },
961
+ "model.layers.29.self_attn.q_proj": {
962
+ "group_size": 64,
963
+ "bits": 4
964
+ },
965
+ "model.layers.29.self_attn.k_proj": {
966
+ "group_size": 64,
967
+ "bits": 6
968
+ },
969
+ "model.layers.29.self_attn.v_proj": {
970
+ "group_size": 64,
971
+ "bits": 8
972
+ },
973
+ "model.layers.29.self_attn.o_proj": {
974
+ "group_size": 64,
975
+ "bits": 5
976
+ },
977
+ "model.layers.29.block_sparse_moe.switch_mlp.gate_proj": {
978
+ "group_size": 64,
979
+ "bits": 4
980
+ },
981
+ "model.layers.29.block_sparse_moe.switch_mlp.up_proj": {
982
+ "group_size": 64,
983
+ "bits": 2
984
+ },
985
+ "model.layers.29.block_sparse_moe.switch_mlp.down_proj": {
986
+ "group_size": 64,
987
+ "bits": 4
988
+ },
989
+ "model.layers.30.self_attn.q_proj": {
990
+ "group_size": 64,
991
+ "bits": 5
992
+ },
993
+ "model.layers.30.self_attn.k_proj": {
994
+ "group_size": 64,
995
+ "bits": 6
996
+ },
997
+ "model.layers.30.self_attn.v_proj": {
998
+ "group_size": 64,
999
+ "bits": 8
1000
+ },
1001
+ "model.layers.30.self_attn.o_proj": {
1002
+ "group_size": 64,
1003
+ "bits": 5
1004
+ },
1005
+ "model.layers.30.block_sparse_moe.gate": {
1006
+ "group_size": 64,
1007
+ "bits": 8
1008
+ },
1009
+ "model.layers.30.block_sparse_moe.switch_mlp.gate_proj": {
1010
+ "group_size": 64,
1011
+ "bits": 2
1012
+ },
1013
+ "model.layers.30.block_sparse_moe.switch_mlp.up_proj": {
1014
+ "group_size": 64,
1015
+ "bits": 2
1016
+ },
1017
+ "model.layers.30.block_sparse_moe.switch_mlp.down_proj": {
1018
+ "group_size": 64,
1019
+ "bits": 4
1020
+ },
1021
+ "model.layers.31.self_attn.q_proj": {
1022
+ "group_size": 64,
1023
+ "bits": 4
1024
+ },
1025
+ "model.layers.31.self_attn.k_proj": {
1026
+ "group_size": 64,
1027
+ "bits": 6
1028
+ },
1029
+ "model.layers.31.self_attn.v_proj": {
1030
+ "group_size": 64,
1031
+ "bits": 8
1032
+ },
1033
+ "model.layers.31.self_attn.o_proj": {
1034
+ "group_size": 64,
1035
+ "bits": 5
1036
+ },
1037
+ "model.layers.31.block_sparse_moe.gate": {
1038
+ "group_size": 64,
1039
+ "bits": 8
1040
+ },
1041
+ "model.layers.31.block_sparse_moe.switch_mlp.gate_proj": {
1042
+ "group_size": 64,
1043
+ "bits": 2
1044
+ },
1045
+ "model.layers.31.block_sparse_moe.switch_mlp.up_proj": {
1046
+ "group_size": 64,
1047
+ "bits": 2
1048
+ },
1049
+ "model.layers.31.block_sparse_moe.switch_mlp.down_proj": {
1050
+ "group_size": 64,
1051
+ "bits": 4
1052
+ },
1053
+ "model.layers.32.self_attn.q_proj": {
1054
+ "group_size": 64,
1055
+ "bits": 5
1056
+ },
1057
+ "model.layers.32.self_attn.k_proj": {
1058
+ "group_size": 64,
1059
+ "bits": 6
1060
+ },
1061
+ "model.layers.32.self_attn.v_proj": {
1062
+ "group_size": 64,
1063
+ "bits": 8
1064
+ },
1065
+ "model.layers.32.self_attn.o_proj": {
1066
+ "group_size": 64,
1067
+ "bits": 5
1068
+ },
1069
+ "model.layers.32.block_sparse_moe.switch_mlp.gate_proj": {
1070
+ "group_size": 64,
1071
+ "bits": 4
1072
+ },
1073
+ "model.layers.32.block_sparse_moe.switch_mlp.up_proj": {
1074
+ "group_size": 64,
1075
+ "bits": 2
1076
+ },
1077
+ "model.layers.32.block_sparse_moe.switch_mlp.down_proj": {
1078
+ "group_size": 64,
1079
+ "bits": 4
1080
+ },
1081
+ "model.layers.33.self_attn.q_proj": {
1082
+ "group_size": 64,
1083
+ "bits": 5
1084
+ },
1085
+ "model.layers.33.self_attn.k_proj": {
1086
+ "group_size": 64,
1087
+ "bits": 6
1088
+ },
1089
+ "model.layers.33.self_attn.v_proj": {
1090
+ "group_size": 64,
1091
+ "bits": 8
1092
+ },
1093
+ "model.layers.33.self_attn.o_proj": {
1094
+ "group_size": 64,
1095
+ "bits": 5
1096
+ },
1097
+ "model.layers.33.block_sparse_moe.gate": {
1098
+ "group_size": 64,
1099
+ "bits": 8
1100
+ },
1101
+ "model.layers.33.block_sparse_moe.switch_mlp.gate_proj": {
1102
+ "group_size": 64,
1103
+ "bits": 4
1104
+ },
1105
+ "model.layers.33.block_sparse_moe.switch_mlp.up_proj": {
1106
+ "group_size": 64,
1107
+ "bits": 4
1108
+ },
1109
+ "model.layers.33.block_sparse_moe.switch_mlp.down_proj": {
1110
+ "group_size": 64,
1111
+ "bits": 4
1112
+ },
1113
+ "model.layers.34.self_attn.q_proj": {
1114
+ "group_size": 64,
1115
+ "bits": 5
1116
+ },
1117
+ "model.layers.34.self_attn.k_proj": {
1118
+ "group_size": 64,
1119
+ "bits": 6
1120
+ },
1121
+ "model.layers.34.self_attn.v_proj": {
1122
+ "group_size": 64,
1123
+ "bits": 8
1124
+ },
1125
+ "model.layers.34.self_attn.o_proj": {
1126
+ "group_size": 64,
1127
+ "bits": 5
1128
+ },
1129
+ "model.layers.34.block_sparse_moe.gate": {
1130
+ "group_size": 64,
1131
+ "bits": 8
1132
+ },
1133
+ "model.layers.34.block_sparse_moe.switch_mlp.gate_proj": {
1134
+ "group_size": 64,
1135
+ "bits": 2
1136
+ },
1137
+ "model.layers.34.block_sparse_moe.switch_mlp.up_proj": {
1138
+ "group_size": 64,
1139
+ "bits": 2
1140
+ },
1141
+ "model.layers.34.block_sparse_moe.switch_mlp.down_proj": {
1142
+ "group_size": 64,
1143
+ "bits": 2
1144
+ },
1145
+ "model.layers.35.self_attn.q_proj": {
1146
+ "group_size": 64,
1147
+ "bits": 5
1148
+ },
1149
+ "model.layers.35.self_attn.k_proj": {
1150
+ "group_size": 64,
1151
+ "bits": 6
1152
+ },
1153
+ "model.layers.35.self_attn.v_proj": {
1154
+ "group_size": 64,
1155
+ "bits": 8
1156
+ },
1157
+ "model.layers.35.self_attn.o_proj": {
1158
+ "group_size": 64,
1159
+ "bits": 6
1160
+ },
1161
+ "model.layers.35.block_sparse_moe.switch_mlp.gate_proj": {
1162
+ "group_size": 64,
1163
+ "bits": 2
1164
+ },
1165
+ "model.layers.35.block_sparse_moe.switch_mlp.up_proj": {
1166
+ "group_size": 64,
1167
+ "bits": 2
1168
+ },
1169
+ "model.layers.35.block_sparse_moe.switch_mlp.down_proj": {
1170
+ "group_size": 64,
1171
+ "bits": 4
1172
+ },
1173
+ "model.layers.36.self_attn.q_proj": {
1174
+ "group_size": 64,
1175
+ "bits": 4
1176
+ },
1177
+ "model.layers.36.self_attn.k_proj": {
1178
+ "group_size": 64,
1179
+ "bits": 6
1180
+ },
1181
+ "model.layers.36.self_attn.v_proj": {
1182
+ "group_size": 64,
1183
+ "bits": 8
1184
+ },
1185
+ "model.layers.36.self_attn.o_proj": {
1186
+ "group_size": 64,
1187
+ "bits": 6
1188
+ },
1189
+ "model.layers.36.block_sparse_moe.switch_mlp.gate_proj": {
1190
+ "group_size": 64,
1191
+ "bits": 4
1192
+ },
1193
+ "model.layers.36.block_sparse_moe.switch_mlp.up_proj": {
1194
+ "group_size": 64,
1195
+ "bits": 4
1196
+ },
1197
+ "model.layers.36.block_sparse_moe.switch_mlp.down_proj": {
1198
+ "group_size": 64,
1199
+ "bits": 4
1200
+ },
1201
+ "model.layers.37.self_attn.q_proj": {
1202
+ "group_size": 64,
1203
+ "bits": 5
1204
+ },
1205
+ "model.layers.37.self_attn.k_proj": {
1206
+ "group_size": 64,
1207
+ "bits": 6
1208
+ },
1209
+ "model.layers.37.self_attn.v_proj": {
1210
+ "group_size": 64,
1211
+ "bits": 8
1212
+ },
1213
+ "model.layers.37.self_attn.o_proj": {
1214
+ "group_size": 64,
1215
+ "bits": 6
1216
+ },
1217
+ "model.layers.37.block_sparse_moe.gate": {
1218
+ "group_size": 64,
1219
+ "bits": 8
1220
+ },
1221
+ "model.layers.37.block_sparse_moe.switch_mlp.gate_proj": {
1222
+ "group_size": 64,
1223
+ "bits": 4
1224
+ },
1225
+ "model.layers.37.block_sparse_moe.switch_mlp.up_proj": {
1226
+ "group_size": 64,
1227
+ "bits": 4
1228
+ },
1229
+ "model.layers.37.block_sparse_moe.switch_mlp.down_proj": {
1230
+ "group_size": 64,
1231
+ "bits": 4
1232
+ },
1233
+ "model.layers.38.self_attn.q_proj": {
1234
+ "group_size": 64,
1235
+ "bits": 5
1236
+ },
1237
+ "model.layers.38.self_attn.k_proj": {
1238
+ "group_size": 64,
1239
+ "bits": 6
1240
+ },
1241
+ "model.layers.38.self_attn.v_proj": {
1242
+ "group_size": 64,
1243
+ "bits": 8
1244
+ },
1245
+ "model.layers.38.self_attn.o_proj": {
1246
+ "group_size": 64,
1247
+ "bits": 6
1248
+ },
1249
+ "model.layers.38.block_sparse_moe.switch_mlp.gate_proj": {
1250
+ "group_size": 64,
1251
+ "bits": 4
1252
+ },
1253
+ "model.layers.38.block_sparse_moe.switch_mlp.up_proj": {
1254
+ "group_size": 64,
1255
+ "bits": 2
1256
+ },
1257
+ "model.layers.38.block_sparse_moe.switch_mlp.down_proj": {
1258
+ "group_size": 64,
1259
+ "bits": 2
1260
+ },
1261
+ "model.layers.39.self_attn.q_proj": {
1262
+ "group_size": 64,
1263
+ "bits": 5
1264
+ },
1265
+ "model.layers.39.self_attn.k_proj": {
1266
+ "group_size": 64,
1267
+ "bits": 8
1268
+ },
1269
+ "model.layers.39.self_attn.v_proj": {
1270
+ "group_size": 64,
1271
+ "bits": 8
1272
+ },
1273
+ "model.layers.39.self_attn.o_proj": {
1274
+ "group_size": 64,
1275
+ "bits": 6
1276
+ },
1277
+ "model.layers.39.block_sparse_moe.switch_mlp.gate_proj": {
1278
+ "group_size": 64,
1279
+ "bits": 4
1280
+ },
1281
+ "model.layers.39.block_sparse_moe.switch_mlp.up_proj": {
1282
+ "group_size": 64,
1283
+ "bits": 4
1284
+ },
1285
+ "model.layers.39.block_sparse_moe.switch_mlp.down_proj": {
1286
+ "group_size": 64,
1287
+ "bits": 4
1288
+ },
1289
+ "model.layers.40.self_attn.q_proj": {
1290
+ "group_size": 64,
1291
+ "bits": 5
1292
+ },
1293
+ "model.layers.40.self_attn.k_proj": {
1294
+ "group_size": 64,
1295
+ "bits": 6
1296
+ },
1297
+ "model.layers.40.self_attn.v_proj": {
1298
+ "group_size": 64,
1299
+ "bits": 8
1300
+ },
1301
+ "model.layers.40.self_attn.o_proj": {
1302
+ "group_size": 64,
1303
+ "bits": 6
1304
+ },
1305
+ "model.layers.40.block_sparse_moe.switch_mlp.gate_proj": {
1306
+ "group_size": 64,
1307
+ "bits": 4
1308
+ },
1309
+ "model.layers.40.block_sparse_moe.switch_mlp.up_proj": {
1310
+ "group_size": 64,
1311
+ "bits": 4
1312
+ },
1313
+ "model.layers.40.block_sparse_moe.switch_mlp.down_proj": {
1314
+ "group_size": 64,
1315
+ "bits": 4
1316
+ },
1317
+ "model.layers.41.self_attn.q_proj": {
1318
+ "group_size": 64,
1319
+ "bits": 5
1320
+ },
1321
+ "model.layers.41.self_attn.k_proj": {
1322
+ "group_size": 64,
1323
+ "bits": 6
1324
+ },
1325
+ "model.layers.41.self_attn.v_proj": {
1326
+ "group_size": 64,
1327
+ "bits": 8
1328
+ },
1329
+ "model.layers.41.self_attn.o_proj": {
1330
+ "group_size": 64,
1331
+ "bits": 6
1332
+ },
1333
+ "model.layers.41.block_sparse_moe.switch_mlp.gate_proj": {
1334
+ "group_size": 64,
1335
+ "bits": 4
1336
+ },
1337
+ "model.layers.41.block_sparse_moe.switch_mlp.up_proj": {
1338
+ "group_size": 64,
1339
+ "bits": 4
1340
+ },
1341
+ "model.layers.41.block_sparse_moe.switch_mlp.down_proj": {
1342
+ "group_size": 64,
1343
+ "bits": 4
1344
+ },
1345
+ "model.layers.42.self_attn.q_proj": {
1346
+ "group_size": 64,
1347
+ "bits": 6
1348
+ },
1349
+ "model.layers.42.self_attn.k_proj": {
1350
+ "group_size": 64,
1351
+ "bits": 8
1352
+ },
1353
+ "model.layers.42.self_attn.v_proj": {
1354
+ "group_size": 64,
1355
+ "bits": 8
1356
+ },
1357
+ "model.layers.42.self_attn.o_proj": {
1358
+ "group_size": 64,
1359
+ "bits": 6
1360
+ },
1361
+ "model.layers.42.block_sparse_moe.switch_mlp.gate_proj": {
1362
+ "group_size": 64,
1363
+ "bits": 4
1364
+ },
1365
+ "model.layers.42.block_sparse_moe.switch_mlp.up_proj": {
1366
+ "group_size": 64,
1367
+ "bits": 4
1368
+ },
1369
+ "model.layers.42.block_sparse_moe.switch_mlp.down_proj": {
1370
+ "group_size": 64,
1371
+ "bits": 4
1372
+ },
1373
+ "model.layers.43.self_attn.q_proj": {
1374
+ "group_size": 64,
1375
+ "bits": 5
1376
+ },
1377
+ "model.layers.43.self_attn.k_proj": {
1378
+ "group_size": 64,
1379
+ "bits": 8
1380
+ },
1381
+ "model.layers.43.self_attn.v_proj": {
1382
+ "group_size": 64,
1383
+ "bits": 8
1384
+ },
1385
+ "model.layers.43.self_attn.o_proj": {
1386
+ "group_size": 64,
1387
+ "bits": 6
1388
+ },
1389
+ "model.layers.43.block_sparse_moe.switch_mlp.gate_proj": {
1390
+ "group_size": 64,
1391
+ "bits": 4
1392
+ },
1393
+ "model.layers.43.block_sparse_moe.switch_mlp.up_proj": {
1394
+ "group_size": 64,
1395
+ "bits": 4
1396
+ },
1397
+ "model.layers.43.block_sparse_moe.switch_mlp.down_proj": {
1398
+ "group_size": 64,
1399
+ "bits": 4
1400
+ },
1401
+ "model.layers.44.self_attn.q_proj": {
1402
+ "group_size": 64,
1403
+ "bits": 6
1404
+ },
1405
+ "model.layers.44.self_attn.k_proj": {
1406
+ "group_size": 64,
1407
+ "bits": 8
1408
+ },
1409
+ "model.layers.44.self_attn.v_proj": {
1410
+ "group_size": 64,
1411
+ "bits": 8
1412
+ },
1413
+ "model.layers.44.self_attn.o_proj": {
1414
+ "group_size": 64,
1415
+ "bits": 6
1416
+ },
1417
+ "model.layers.44.block_sparse_moe.switch_mlp.gate_proj": {
1418
+ "group_size": 64,
1419
+ "bits": 4
1420
+ },
1421
+ "model.layers.44.block_sparse_moe.switch_mlp.up_proj": {
1422
+ "group_size": 64,
1423
+ "bits": 4
1424
+ },
1425
+ "model.layers.44.block_sparse_moe.switch_mlp.down_proj": {
1426
+ "group_size": 64,
1427
+ "bits": 4
1428
+ },
1429
+ "model.layers.45.block_sparse_moe.switch_mlp.gate_proj": {
1430
+ "group_size": 64,
1431
+ "bits": 5
1432
+ },
1433
+ "model.layers.45.block_sparse_moe.switch_mlp.up_proj": {
1434
+ "group_size": 64,
1435
+ "bits": 5
1436
+ },
1437
+ "model.layers.45.block_sparse_moe.switch_mlp.down_proj": {
1438
+ "group_size": 64,
1439
+ "bits": 5
1440
+ },
1441
+ "model.layers.46.block_sparse_moe.switch_mlp.gate_proj": {
1442
+ "group_size": 64,
1443
+ "bits": 5
1444
+ },
1445
+ "model.layers.46.block_sparse_moe.switch_mlp.up_proj": {
1446
+ "group_size": 64,
1447
+ "bits": 5
1448
+ },
1449
+ "model.layers.46.block_sparse_moe.switch_mlp.down_proj": {
1450
+ "group_size": 64,
1451
+ "bits": 5
1452
+ },
1453
+ "model.layers.47.block_sparse_moe.switch_mlp.gate_proj": {
1454
+ "group_size": 64,
1455
+ "bits": 5
1456
+ },
1457
+ "model.layers.47.block_sparse_moe.switch_mlp.up_proj": {
1458
+ "group_size": 64,
1459
+ "bits": 5
1460
+ },
1461
+ "model.layers.47.block_sparse_moe.switch_mlp.down_proj": {
1462
+ "group_size": 64,
1463
+ "bits": 5
1464
+ },
1465
+ "model.layers.48.block_sparse_moe.switch_mlp.gate_proj": {
1466
+ "group_size": 64,
1467
+ "bits": 5
1468
+ },
1469
+ "model.layers.48.block_sparse_moe.switch_mlp.up_proj": {
1470
+ "group_size": 64,
1471
+ "bits": 5
1472
+ },
1473
+ "model.layers.48.block_sparse_moe.switch_mlp.down_proj": {
1474
+ "group_size": 64,
1475
+ "bits": 5
1476
+ },
1477
+ "model.layers.49.block_sparse_moe.switch_mlp.gate_proj": {
1478
+ "group_size": 64,
1479
+ "bits": 5
1480
+ },
1481
+ "model.layers.49.block_sparse_moe.switch_mlp.up_proj": {
1482
+ "group_size": 64,
1483
+ "bits": 5
1484
+ },
1485
+ "model.layers.49.block_sparse_moe.switch_mlp.down_proj": {
1486
+ "group_size": 64,
1487
+ "bits": 5
1488
+ },
1489
+ "model.layers.50.block_sparse_moe.switch_mlp.gate_proj": {
1490
+ "group_size": 64,
1491
+ "bits": 5
1492
+ },
1493
+ "model.layers.50.block_sparse_moe.switch_mlp.up_proj": {
1494
+ "group_size": 64,
1495
+ "bits": 5
1496
+ },
1497
+ "model.layers.50.block_sparse_moe.switch_mlp.down_proj": {
1498
+ "group_size": 64,
1499
+ "bits": 5
1500
+ },
1501
+ "model.layers.51.block_sparse_moe.switch_mlp.gate_proj": {
1502
+ "group_size": 64,
1503
+ "bits": 5
1504
+ },
1505
+ "model.layers.51.block_sparse_moe.switch_mlp.up_proj": {
1506
+ "group_size": 64,
1507
+ "bits": 5
1508
+ },
1509
+ "model.layers.51.block_sparse_moe.switch_mlp.down_proj": {
1510
+ "group_size": 64,
1511
+ "bits": 5
1512
+ },
1513
+ "model.layers.52.block_sparse_moe.switch_mlp.gate_proj": {
1514
+ "group_size": 64,
1515
+ "bits": 5
1516
+ },
1517
+ "model.layers.52.block_sparse_moe.switch_mlp.up_proj": {
1518
+ "group_size": 64,
1519
+ "bits": 5
1520
+ },
1521
+ "model.layers.52.block_sparse_moe.switch_mlp.down_proj": {
1522
+ "group_size": 64,
1523
+ "bits": 5
1524
+ },
1525
+ "model.layers.53.block_sparse_moe.switch_mlp.gate_proj": {
1526
+ "group_size": 64,
1527
+ "bits": 5
1528
+ },
1529
+ "model.layers.53.block_sparse_moe.switch_mlp.up_proj": {
1530
+ "group_size": 64,
1531
+ "bits": 5
1532
+ },
1533
+ "model.layers.53.block_sparse_moe.switch_mlp.down_proj": {
1534
+ "group_size": 64,
1535
+ "bits": 6
1536
+ },
1537
+ "model.layers.54.block_sparse_moe.switch_mlp.gate_proj": {
1538
+ "group_size": 64,
1539
+ "bits": 6
1540
+ },
1541
+ "model.layers.54.block_sparse_moe.switch_mlp.up_proj": {
1542
+ "group_size": 64,
1543
+ "bits": 6
1544
+ },
1545
+ "model.layers.54.block_sparse_moe.switch_mlp.down_proj": {
1546
+ "group_size": 64,
1547
+ "bits": 6
1548
+ },
1549
+ "model.layers.55.block_sparse_moe.switch_mlp.gate_proj": {
1550
+ "group_size": 64,
1551
+ "bits": 6
1552
+ },
1553
+ "model.layers.55.block_sparse_moe.switch_mlp.up_proj": {
1554
+ "group_size": 64,
1555
+ "bits": 6
1556
+ },
1557
+ "model.layers.55.block_sparse_moe.switch_mlp.down_proj": {
1558
+ "group_size": 64,
1559
+ "bits": 6
1560
+ },
1561
+ "model.layers.56.block_sparse_moe.switch_mlp.gate_proj": {
1562
+ "group_size": 64,
1563
+ "bits": 6
1564
+ },
1565
+ "model.layers.56.block_sparse_moe.switch_mlp.up_proj": {
1566
+ "group_size": 64,
1567
+ "bits": 6
1568
+ },
1569
+ "model.layers.56.block_sparse_moe.switch_mlp.down_proj": {
1570
+ "group_size": 64,
1571
+ "bits": 6
1572
+ },
1573
+ "model.layers.57.block_sparse_moe.switch_mlp.gate_proj": {
1574
+ "group_size": 64,
1575
+ "bits": 6
1576
+ },
1577
+ "model.layers.57.block_sparse_moe.switch_mlp.up_proj": {
1578
+ "group_size": 64,
1579
+ "bits": 6
1580
+ },
1581
+ "model.layers.57.block_sparse_moe.switch_mlp.down_proj": {
1582
+ "group_size": 64,
1583
+ "bits": 6
1584
+ },
1585
+ "model.layers.58.block_sparse_moe.switch_mlp.gate_proj": {
1586
+ "group_size": 64,
1587
+ "bits": 6
1588
+ },
1589
+ "model.layers.58.block_sparse_moe.switch_mlp.up_proj": {
1590
+ "group_size": 64,
1591
+ "bits": 6
1592
+ },
1593
+ "model.layers.58.block_sparse_moe.switch_mlp.down_proj": {
1594
+ "group_size": 64,
1595
+ "bits": 6
1596
+ },
1597
+ "model.layers.59.block_sparse_moe.switch_mlp.gate_proj": {
1598
+ "group_size": 64,
1599
+ "bits": 6
1600
+ },
1601
+ "model.layers.59.block_sparse_moe.switch_mlp.up_proj": {
1602
+ "group_size": 64,
1603
+ "bits": 6
1604
+ },
1605
+ "model.layers.59.block_sparse_moe.switch_mlp.down_proj": {
1606
+ "group_size": 64,
1607
+ "bits": 6
1608
+ },
1609
+ "model.layers.60.block_sparse_moe.switch_mlp.gate_proj": {
1610
+ "group_size": 64,
1611
+ "bits": 5
1612
+ },
1613
+ "model.layers.60.block_sparse_moe.switch_mlp.up_proj": {
1614
+ "group_size": 64,
1615
+ "bits": 5
1616
+ },
1617
+ "model.layers.60.block_sparse_moe.switch_mlp.down_proj": {
1618
+ "group_size": 64,
1619
+ "bits": 5
1620
+ },
1621
+ "model.layers.61.block_sparse_moe.switch_mlp.gate_proj": {
1622
+ "group_size": 64,
1623
+ "bits": 6
1624
+ },
1625
+ "model.layers.61.block_sparse_moe.switch_mlp.up_proj": {
1626
+ "group_size": 64,
1627
+ "bits": 8
1628
+ },
1629
+ "model.layers.61.block_sparse_moe.switch_mlp.down_proj": {
1630
+ "group_size": 64,
1631
+ "bits": 6
1632
+ }
1633
+ },
1634
+ "quantization_config": {
1635
+ "group_size": 64,
1636
+ "bits": 4,
1637
+ "mode": "affine",
1638
+ "model.layers.0.self_attn.q_proj": {
1639
+ "group_size": 64,
1640
+ "bits": 6
1641
+ },
1642
+ "model.layers.0.self_attn.k_proj": {
1643
+ "group_size": 64,
1644
+ "bits": 8
1645
+ },
1646
+ "model.layers.0.self_attn.v_proj": {
1647
+ "group_size": 64,
1648
+ "bits": 8
1649
+ },
1650
+ "model.layers.0.self_attn.o_proj": {
1651
+ "group_size": 64,
1652
+ "bits": 8
1653
+ },
1654
+ "model.layers.0.block_sparse_moe.switch_mlp.gate_proj": {
1655
+ "group_size": 64,
1656
+ "bits": 4
1657
+ },
1658
+ "model.layers.0.block_sparse_moe.switch_mlp.up_proj": {
1659
+ "group_size": 64,
1660
+ "bits": 4
1661
+ },
1662
+ "model.layers.0.block_sparse_moe.switch_mlp.down_proj": {
1663
+ "group_size": 64,
1664
+ "bits": 4
1665
+ },
1666
+ "model.layers.1.self_attn.o_proj": {
1667
+ "group_size": 64,
1668
+ "bits": 8
1669
+ },
1670
+ "model.layers.1.block_sparse_moe.switch_mlp.gate_proj": {
1671
+ "group_size": 64,
1672
+ "bits": 4
1673
+ },
1674
+ "model.layers.1.block_sparse_moe.switch_mlp.up_proj": {
1675
+ "group_size": 64,
1676
+ "bits": 4
1677
+ },
1678
+ "model.layers.1.block_sparse_moe.switch_mlp.down_proj": {
1679
+ "group_size": 64,
1680
+ "bits": 4
1681
+ },
1682
+ "model.layers.2.self_attn.q_proj": {
1683
+ "group_size": 64,
1684
+ "bits": 4
1685
+ },
1686
+ "model.layers.2.self_attn.k_proj": {
1687
+ "group_size": 64,
1688
+ "bits": 8
1689
+ },
1690
+ "model.layers.2.self_attn.v_proj": {
1691
+ "group_size": 64,
1692
+ "bits": 8
1693
+ },
1694
+ "model.layers.2.self_attn.o_proj": {
1695
+ "group_size": 64,
1696
+ "bits": 5
1697
+ },
1698
+ "model.layers.2.block_sparse_moe.switch_mlp.gate_proj": {
1699
+ "group_size": 64,
1700
+ "bits": 3
1701
+ },
1702
+ "model.layers.2.block_sparse_moe.switch_mlp.up_proj": {
1703
+ "group_size": 64,
1704
+ "bits": 3
1705
+ },
1706
+ "model.layers.2.block_sparse_moe.switch_mlp.down_proj": {
1707
+ "group_size": 64,
1708
+ "bits": 4
1709
+ },
1710
+ "model.layers.3.self_attn.q_proj": {
1711
+ "group_size": 64,
1712
+ "bits": 5
1713
+ },
1714
+ "model.layers.3.self_attn.k_proj": {
1715
+ "group_size": 64,
1716
+ "bits": 5
1717
+ },
1718
+ "model.layers.3.self_attn.v_proj": {
1719
+ "group_size": 64,
1720
+ "bits": 8
1721
+ },
1722
+ "model.layers.3.self_attn.o_proj": {
1723
+ "group_size": 64,
1724
+ "bits": 5
1725
+ },
1726
+ "model.layers.3.block_sparse_moe.switch_mlp.gate_proj": {
1727
+ "group_size": 64,
1728
+ "bits": 4
1729
+ },
1730
+ "model.layers.3.block_sparse_moe.switch_mlp.up_proj": {
1731
+ "group_size": 64,
1732
+ "bits": 3
1733
+ },
1734
+ "model.layers.3.block_sparse_moe.switch_mlp.down_proj": {
1735
+ "group_size": 64,
1736
+ "bits": 4
1737
+ },
1738
+ "model.layers.4.self_attn.q_proj": {
1739
+ "group_size": 64,
1740
+ "bits": 5
1741
+ },
1742
+ "model.layers.4.self_attn.k_proj": {
1743
+ "group_size": 64,
1744
+ "bits": 6
1745
+ },
1746
+ "model.layers.4.self_attn.v_proj": {
1747
+ "group_size": 64,
1748
+ "bits": 8
1749
+ },
1750
+ "model.layers.4.self_attn.o_proj": {
1751
+ "group_size": 64,
1752
+ "bits": 5
1753
+ },
1754
+ "model.layers.4.block_sparse_moe.switch_mlp.gate_proj": {
1755
+ "group_size": 64,
1756
+ "bits": 3
1757
+ },
1758
+ "model.layers.4.block_sparse_moe.switch_mlp.up_proj": {
1759
+ "group_size": 64,
1760
+ "bits": 3
1761
+ },
1762
+ "model.layers.4.block_sparse_moe.switch_mlp.down_proj": {
1763
+ "group_size": 64,
1764
+ "bits": 3
1765
+ },
1766
+ "model.layers.5.self_attn.q_proj": {
1767
+ "group_size": 64,
1768
+ "bits": 5
1769
+ },
1770
+ "model.layers.5.self_attn.k_proj": {
1771
+ "group_size": 64,
1772
+ "bits": 8
1773
+ },
1774
+ "model.layers.5.self_attn.v_proj": {
1775
+ "group_size": 64,
1776
+ "bits": 8
1777
+ },
1778
+ "model.layers.5.self_attn.o_proj": {
1779
+ "group_size": 64,
1780
+ "bits": 5
1781
+ },
1782
+ "model.layers.5.block_sparse_moe.switch_mlp.gate_proj": {
1783
+ "group_size": 64,
1784
+ "bits": 3
1785
+ },
1786
+ "model.layers.5.block_sparse_moe.switch_mlp.up_proj": {
1787
+ "group_size": 64,
1788
+ "bits": 4
1789
+ },
1790
+ "model.layers.5.block_sparse_moe.switch_mlp.down_proj": {
1791
+ "group_size": 64,
1792
+ "bits": 4
1793
+ },
1794
+ "model.layers.6.self_attn.q_proj": {
1795
+ "group_size": 64,
1796
+ "bits": 3
1797
+ },
1798
+ "model.layers.6.self_attn.k_proj": {
1799
+ "group_size": 64,
1800
+ "bits": 4
1801
+ },
1802
+ "model.layers.6.self_attn.v_proj": {
1803
+ "group_size": 64,
1804
+ "bits": 6
1805
+ },
1806
+ "model.layers.6.self_attn.o_proj": {
1807
+ "group_size": 64,
1808
+ "bits": 4
1809
+ },
1810
+ "model.layers.6.block_sparse_moe.switch_mlp.gate_proj": {
1811
+ "group_size": 64,
1812
+ "bits": 4
1813
+ },
1814
+ "model.layers.6.block_sparse_moe.switch_mlp.up_proj": {
1815
+ "group_size": 64,
1816
+ "bits": 4
1817
+ },
1818
+ "model.layers.6.block_sparse_moe.switch_mlp.down_proj": {
1819
+ "group_size": 64,
1820
+ "bits": 3
1821
+ },
1822
+ "model.layers.7.self_attn.q_proj": {
1823
+ "group_size": 64,
1824
+ "bits": 4
1825
+ },
1826
+ "model.layers.7.self_attn.k_proj": {
1827
+ "group_size": 64,
1828
+ "bits": 5
1829
+ },
1830
+ "model.layers.7.self_attn.v_proj": {
1831
+ "group_size": 64,
1832
+ "bits": 6
1833
+ },
1834
+ "model.layers.7.self_attn.o_proj": {
1835
+ "group_size": 64,
1836
+ "bits": 4
1837
+ },
1838
+ "model.layers.7.block_sparse_moe.switch_mlp.gate_proj": {
1839
+ "group_size": 64,
1840
+ "bits": 3
1841
+ },
1842
+ "model.layers.7.block_sparse_moe.switch_mlp.up_proj": {
1843
+ "group_size": 64,
1844
+ "bits": 3
1845
+ },
1846
+ "model.layers.7.block_sparse_moe.switch_mlp.down_proj": {
1847
+ "group_size": 64,
1848
+ "bits": 3
1849
+ },
1850
+ "model.layers.8.self_attn.q_proj": {
1851
+ "group_size": 64,
1852
+ "bits": 3
1853
+ },
1854
+ "model.layers.8.self_attn.k_proj": {
1855
+ "group_size": 64,
1856
+ "bits": 5
1857
+ },
1858
+ "model.layers.8.self_attn.v_proj": {
1859
+ "group_size": 64,
1860
+ "bits": 5
1861
+ },
1862
+ "model.layers.8.self_attn.o_proj": {
1863
+ "group_size": 64,
1864
+ "bits": 4
1865
+ },
1866
+ "model.layers.8.block_sparse_moe.gate": {
1867
+ "group_size": 64,
1868
+ "bits": 8
1869
+ },
1870
+ "model.layers.8.block_sparse_moe.switch_mlp.gate_proj": {
1871
+ "group_size": 64,
1872
+ "bits": 4
1873
+ },
1874
+ "model.layers.8.block_sparse_moe.switch_mlp.up_proj": {
1875
+ "group_size": 64,
1876
+ "bits": 4
1877
+ },
1878
+ "model.layers.8.block_sparse_moe.switch_mlp.down_proj": {
1879
+ "group_size": 64,
1880
+ "bits": 3
1881
+ },
1882
+ "model.layers.9.self_attn.q_proj": {
1883
+ "group_size": 64,
1884
+ "bits": 3
1885
+ },
1886
+ "model.layers.9.self_attn.k_proj": {
1887
+ "group_size": 64,
1888
+ "bits": 4
1889
+ },
1890
+ "model.layers.9.self_attn.v_proj": {
1891
+ "group_size": 64,
1892
+ "bits": 6
1893
+ },
1894
+ "model.layers.9.self_attn.o_proj": {
1895
+ "group_size": 64,
1896
+ "bits": 4
1897
+ },
1898
+ "model.layers.9.block_sparse_moe.gate": {
1899
+ "group_size": 64,
1900
+ "bits": 8
1901
+ },
1902
+ "model.layers.9.block_sparse_moe.switch_mlp.gate_proj": {
1903
+ "group_size": 64,
1904
+ "bits": 4
1905
+ },
1906
+ "model.layers.9.block_sparse_moe.switch_mlp.up_proj": {
1907
+ "group_size": 64,
1908
+ "bits": 4
1909
+ },
1910
+ "model.layers.9.block_sparse_moe.switch_mlp.down_proj": {
1911
+ "group_size": 64,
1912
+ "bits": 4
1913
+ },
1914
+ "model.layers.10.self_attn.q_proj": {
1915
+ "group_size": 64,
1916
+ "bits": 3
1917
+ },
1918
+ "model.layers.10.self_attn.k_proj": {
1919
+ "group_size": 64,
1920
+ "bits": 4
1921
+ },
1922
+ "model.layers.10.self_attn.v_proj": {
1923
+ "group_size": 64,
1924
+ "bits": 5
1925
+ },
1926
+ "model.layers.10.self_attn.o_proj": {
1927
+ "group_size": 64,
1928
+ "bits": 3
1929
+ },
1930
+ "model.layers.10.block_sparse_moe.gate": {
1931
+ "group_size": 64,
1932
+ "bits": 8
1933
+ },
1934
+ "model.layers.10.block_sparse_moe.switch_mlp.gate_proj": {
1935
+ "group_size": 64,
1936
+ "bits": 4
1937
+ },
1938
+ "model.layers.10.block_sparse_moe.switch_mlp.up_proj": {
1939
+ "group_size": 64,
1940
+ "bits": 4
1941
+ },
1942
+ "model.layers.10.block_sparse_moe.switch_mlp.down_proj": {
1943
+ "group_size": 64,
1944
+ "bits": 3
1945
+ },
1946
+ "model.layers.11.self_attn.q_proj": {
1947
+ "group_size": 64,
1948
+ "bits": 4
1949
+ },
1950
+ "model.layers.11.self_attn.k_proj": {
1951
+ "group_size": 64,
1952
+ "bits": 6
1953
+ },
1954
+ "model.layers.11.self_attn.v_proj": {
1955
+ "group_size": 64,
1956
+ "bits": 6
1957
+ },
1958
+ "model.layers.11.self_attn.o_proj": {
1959
+ "group_size": 64,
1960
+ "bits": 4
1961
+ },
1962
+ "model.layers.11.block_sparse_moe.switch_mlp.gate_proj": {
1963
+ "group_size": 64,
1964
+ "bits": 4
1965
+ },
1966
+ "model.layers.11.block_sparse_moe.switch_mlp.up_proj": {
1967
+ "group_size": 64,
1968
+ "bits": 2
1969
+ },
1970
+ "model.layers.11.block_sparse_moe.switch_mlp.down_proj": {
1971
+ "group_size": 64,
1972
+ "bits": 4
1973
+ },
1974
+ "model.layers.12.self_attn.q_proj": {
1975
+ "group_size": 64,
1976
+ "bits": 3
1977
+ },
1978
+ "model.layers.12.self_attn.k_proj": {
1979
+ "group_size": 64,
1980
+ "bits": 5
1981
+ },
1982
+ "model.layers.12.self_attn.v_proj": {
1983
+ "group_size": 64,
1984
+ "bits": 6
1985
+ },
1986
+ "model.layers.12.self_attn.o_proj": {
1987
+ "group_size": 64,
1988
+ "bits": 4
1989
+ },
1990
+ "model.layers.12.block_sparse_moe.gate": {
1991
+ "group_size": 64,
1992
+ "bits": 8
1993
+ },
1994
+ "model.layers.12.block_sparse_moe.switch_mlp.gate_proj": {
1995
+ "group_size": 64,
1996
+ "bits": 4
1997
+ },
1998
+ "model.layers.12.block_sparse_moe.switch_mlp.up_proj": {
1999
+ "group_size": 64,
2000
+ "bits": 2
2001
+ },
2002
+ "model.layers.12.block_sparse_moe.switch_mlp.down_proj": {
2003
+ "group_size": 64,
2004
+ "bits": 4
2005
+ },
2006
+ "model.layers.13.self_attn.q_proj": {
2007
+ "group_size": 64,
2008
+ "bits": 3
2009
+ },
2010
+ "model.layers.13.self_attn.k_proj": {
2011
+ "group_size": 64,
2012
+ "bits": 4
2013
+ },
2014
+ "model.layers.13.self_attn.v_proj": {
2015
+ "group_size": 64,
2016
+ "bits": 6
2017
+ },
2018
+ "model.layers.13.self_attn.o_proj": {
2019
+ "group_size": 64,
2020
+ "bits": 4
2021
+ },
2022
+ "model.layers.13.block_sparse_moe.switch_mlp.gate_proj": {
2023
+ "group_size": 64,
2024
+ "bits": 4
2025
+ },
2026
+ "model.layers.13.block_sparse_moe.switch_mlp.up_proj": {
2027
+ "group_size": 64,
2028
+ "bits": 2
2029
+ },
2030
+ "model.layers.13.block_sparse_moe.switch_mlp.down_proj": {
2031
+ "group_size": 64,
2032
+ "bits": 4
2033
+ },
2034
+ "model.layers.14.self_attn.q_proj": {
2035
+ "group_size": 64,
2036
+ "bits": 3
2037
+ },
2038
+ "model.layers.14.self_attn.k_proj": {
2039
+ "group_size": 64,
2040
+ "bits": 5
2041
+ },
2042
+ "model.layers.14.self_attn.v_proj": {
2043
+ "group_size": 64,
2044
+ "bits": 6
2045
+ },
2046
+ "model.layers.14.self_attn.o_proj": {
2047
+ "group_size": 64,
2048
+ "bits": 4
2049
+ },
2050
+ "model.layers.14.block_sparse_moe.gate": {
2051
+ "group_size": 64,
2052
+ "bits": 8
2053
+ },
2054
+ "model.layers.14.block_sparse_moe.switch_mlp.gate_proj": {
2055
+ "group_size": 64,
2056
+ "bits": 4
2057
+ },
2058
+ "model.layers.14.block_sparse_moe.switch_mlp.up_proj": {
2059
+ "group_size": 64,
2060
+ "bits": 2
2061
+ },
2062
+ "model.layers.14.block_sparse_moe.switch_mlp.down_proj": {
2063
+ "group_size": 64,
2064
+ "bits": 2
2065
+ },
2066
+ "model.layers.15.self_attn.q_proj": {
2067
+ "group_size": 64,
2068
+ "bits": 3
2069
+ },
2070
+ "model.layers.15.self_attn.k_proj": {
2071
+ "group_size": 64,
2072
+ "bits": 5
2073
+ },
2074
+ "model.layers.15.self_attn.v_proj": {
2075
+ "group_size": 64,
2076
+ "bits": 6
2077
+ },
2078
+ "model.layers.15.self_attn.o_proj": {
2079
+ "group_size": 64,
2080
+ "bits": 4
2081
+ },
2082
+ "model.layers.15.block_sparse_moe.gate": {
2083
+ "group_size": 64,
2084
+ "bits": 8
2085
+ },
2086
+ "model.layers.15.block_sparse_moe.switch_mlp.gate_proj": {
2087
+ "group_size": 64,
2088
+ "bits": 2
2089
+ },
2090
+ "model.layers.15.block_sparse_moe.switch_mlp.up_proj": {
2091
+ "group_size": 64,
2092
+ "bits": 2
2093
+ },
2094
+ "model.layers.15.block_sparse_moe.switch_mlp.down_proj": {
2095
+ "group_size": 64,
2096
+ "bits": 2
2097
+ },
2098
+ "model.layers.16.self_attn.q_proj": {
2099
+ "group_size": 64,
2100
+ "bits": 4
2101
+ },
2102
+ "model.layers.16.self_attn.k_proj": {
2103
+ "group_size": 64,
2104
+ "bits": 5
2105
+ },
2106
+ "model.layers.16.self_attn.v_proj": {
2107
+ "group_size": 64,
2108
+ "bits": 6
2109
+ },
2110
+ "model.layers.16.self_attn.o_proj": {
2111
+ "group_size": 64,
2112
+ "bits": 4
2113
+ },
2114
+ "model.layers.16.block_sparse_moe.gate": {
2115
+ "group_size": 64,
2116
+ "bits": 8
2117
+ },
2118
+ "model.layers.16.block_sparse_moe.switch_mlp.gate_proj": {
2119
+ "group_size": 64,
2120
+ "bits": 2
2121
+ },
2122
+ "model.layers.16.block_sparse_moe.switch_mlp.up_proj": {
2123
+ "group_size": 64,
2124
+ "bits": 2
2125
+ },
2126
+ "model.layers.16.block_sparse_moe.switch_mlp.down_proj": {
2127
+ "group_size": 64,
2128
+ "bits": 2
2129
+ },
2130
+ "model.layers.17.self_attn.q_proj": {
2131
+ "group_size": 64,
2132
+ "bits": 3
2133
+ },
2134
+ "model.layers.17.self_attn.k_proj": {
2135
+ "group_size": 64,
2136
+ "bits": 5
2137
+ },
2138
+ "model.layers.17.self_attn.v_proj": {
2139
+ "group_size": 64,
2140
+ "bits": 6
2141
+ },
2142
+ "model.layers.17.self_attn.o_proj": {
2143
+ "group_size": 64,
2144
+ "bits": 4
2145
+ },
2146
+ "model.layers.17.block_sparse_moe.gate": {
2147
+ "group_size": 64,
2148
+ "bits": 8
2149
+ },
2150
+ "model.layers.17.block_sparse_moe.switch_mlp.gate_proj": {
2151
+ "group_size": 64,
2152
+ "bits": 2
2153
+ },
2154
+ "model.layers.17.block_sparse_moe.switch_mlp.up_proj": {
2155
+ "group_size": 64,
2156
+ "bits": 2
2157
+ },
2158
+ "model.layers.17.block_sparse_moe.switch_mlp.down_proj": {
2159
+ "group_size": 64,
2160
+ "bits": 2
2161
+ },
2162
+ "model.layers.18.self_attn.q_proj": {
2163
+ "group_size": 64,
2164
+ "bits": 4
2165
+ },
2166
+ "model.layers.18.self_attn.k_proj": {
2167
+ "group_size": 64,
2168
+ "bits": 5
2169
+ },
2170
+ "model.layers.18.self_attn.v_proj": {
2171
+ "group_size": 64,
2172
+ "bits": 6
2173
+ },
2174
+ "model.layers.18.self_attn.o_proj": {
2175
+ "group_size": 64,
2176
+ "bits": 4
2177
+ },
2178
+ "model.layers.18.block_sparse_moe.gate": {
2179
+ "group_size": 64,
2180
+ "bits": 8
2181
+ },
2182
+ "model.layers.18.block_sparse_moe.switch_mlp.gate_proj": {
2183
+ "group_size": 64,
2184
+ "bits": 2
2185
+ },
2186
+ "model.layers.18.block_sparse_moe.switch_mlp.up_proj": {
2187
+ "group_size": 64,
2188
+ "bits": 2
2189
+ },
2190
+ "model.layers.18.block_sparse_moe.switch_mlp.down_proj": {
2191
+ "group_size": 64,
2192
+ "bits": 2
2193
+ },
2194
+ "model.layers.19.self_attn.q_proj": {
2195
+ "group_size": 64,
2196
+ "bits": 3
2197
+ },
2198
+ "model.layers.19.self_attn.k_proj": {
2199
+ "group_size": 64,
2200
+ "bits": 5
2201
+ },
2202
+ "model.layers.19.self_attn.v_proj": {
2203
+ "group_size": 64,
2204
+ "bits": 6
2205
+ },
2206
+ "model.layers.19.self_attn.o_proj": {
2207
+ "group_size": 64,
2208
+ "bits": 4
2209
+ },
2210
+ "model.layers.19.block_sparse_moe.gate": {
2211
+ "group_size": 64,
2212
+ "bits": 8
2213
+ },
2214
+ "model.layers.19.block_sparse_moe.switch_mlp.gate_proj": {
2215
+ "group_size": 64,
2216
+ "bits": 2
2217
+ },
2218
+ "model.layers.19.block_sparse_moe.switch_mlp.up_proj": {
2219
+ "group_size": 64,
2220
+ "bits": 2
2221
+ },
2222
+ "model.layers.19.block_sparse_moe.switch_mlp.down_proj": {
2223
+ "group_size": 64,
2224
+ "bits": 2
2225
+ },
2226
+ "model.layers.20.self_attn.q_proj": {
2227
+ "group_size": 64,
2228
+ "bits": 3
2229
+ },
2230
+ "model.layers.20.self_attn.k_proj": {
2231
+ "group_size": 64,
2232
+ "bits": 5
2233
+ },
2234
+ "model.layers.20.self_attn.v_proj": {
2235
+ "group_size": 64,
2236
+ "bits": 6
2237
+ },
2238
+ "model.layers.20.self_attn.o_proj": {
2239
+ "group_size": 64,
2240
+ "bits": 4
2241
+ },
2242
+ "model.layers.20.block_sparse_moe.switch_mlp.gate_proj": {
2243
+ "group_size": 64,
2244
+ "bits": 2
2245
+ },
2246
+ "model.layers.20.block_sparse_moe.switch_mlp.up_proj": {
2247
+ "group_size": 64,
2248
+ "bits": 2
2249
+ },
2250
+ "model.layers.20.block_sparse_moe.switch_mlp.down_proj": {
2251
+ "group_size": 64,
2252
+ "bits": 2
2253
+ },
2254
+ "model.layers.21.self_attn.q_proj": {
2255
+ "group_size": 64,
2256
+ "bits": 3
2257
+ },
2258
+ "model.layers.21.self_attn.k_proj": {
2259
+ "group_size": 64,
2260
+ "bits": 4
2261
+ },
2262
+ "model.layers.21.self_attn.v_proj": {
2263
+ "group_size": 64,
2264
+ "bits": 6
2265
+ },
2266
+ "model.layers.21.self_attn.o_proj": {
2267
+ "group_size": 64,
2268
+ "bits": 4
2269
+ },
2270
+ "model.layers.21.block_sparse_moe.gate": {
2271
+ "group_size": 64,
2272
+ "bits": 8
2273
+ },
2274
+ "model.layers.21.block_sparse_moe.switch_mlp.gate_proj": {
2275
+ "group_size": 64,
2276
+ "bits": 2
2277
+ },
2278
+ "model.layers.21.block_sparse_moe.switch_mlp.up_proj": {
2279
+ "group_size": 64,
2280
+ "bits": 2
2281
+ },
2282
+ "model.layers.21.block_sparse_moe.switch_mlp.down_proj": {
2283
+ "group_size": 64,
2284
+ "bits": 2
2285
+ },
2286
+ "model.layers.22.self_attn.q_proj": {
2287
+ "group_size": 64,
2288
+ "bits": 3
2289
+ },
2290
+ "model.layers.22.self_attn.k_proj": {
2291
+ "group_size": 64,
2292
+ "bits": 5
2293
+ },
2294
+ "model.layers.22.self_attn.v_proj": {
2295
+ "group_size": 64,
2296
+ "bits": 6
2297
+ },
2298
+ "model.layers.22.self_attn.o_proj": {
2299
+ "group_size": 64,
2300
+ "bits": 4
2301
+ },
2302
+ "model.layers.22.block_sparse_moe.gate": {
2303
+ "group_size": 64,
2304
+ "bits": 8
2305
+ },
2306
+ "model.layers.22.block_sparse_moe.switch_mlp.gate_proj": {
2307
+ "group_size": 64,
2308
+ "bits": 2
2309
+ },
2310
+ "model.layers.22.block_sparse_moe.switch_mlp.up_proj": {
2311
+ "group_size": 64,
2312
+ "bits": 2
2313
+ },
2314
+ "model.layers.22.block_sparse_moe.switch_mlp.down_proj": {
2315
+ "group_size": 64,
2316
+ "bits": 2
2317
+ },
2318
+ "model.layers.23.self_attn.q_proj": {
2319
+ "group_size": 64,
2320
+ "bits": 4
2321
+ },
2322
+ "model.layers.23.self_attn.k_proj": {
2323
+ "group_size": 64,
2324
+ "bits": 5
2325
+ },
2326
+ "model.layers.23.self_attn.v_proj": {
2327
+ "group_size": 64,
2328
+ "bits": 8
2329
+ },
2330
+ "model.layers.23.self_attn.o_proj": {
2331
+ "group_size": 64,
2332
+ "bits": 4
2333
+ },
2334
+ "model.layers.23.block_sparse_moe.gate": {
2335
+ "group_size": 64,
2336
+ "bits": 8
2337
+ },
2338
+ "model.layers.23.block_sparse_moe.switch_mlp.gate_proj": {
2339
+ "group_size": 64,
2340
+ "bits": 2
2341
+ },
2342
+ "model.layers.23.block_sparse_moe.switch_mlp.up_proj": {
2343
+ "group_size": 64,
2344
+ "bits": 2
2345
+ },
2346
+ "model.layers.23.block_sparse_moe.switch_mlp.down_proj": {
2347
+ "group_size": 64,
2348
+ "bits": 4
2349
+ },
2350
+ "model.layers.24.self_attn.q_proj": {
2351
+ "group_size": 64,
2352
+ "bits": 4
2353
+ },
2354
+ "model.layers.24.self_attn.k_proj": {
2355
+ "group_size": 64,
2356
+ "bits": 6
2357
+ },
2358
+ "model.layers.24.self_attn.v_proj": {
2359
+ "group_size": 64,
2360
+ "bits": 6
2361
+ },
2362
+ "model.layers.24.self_attn.o_proj": {
2363
+ "group_size": 64,
2364
+ "bits": 5
2365
+ },
2366
+ "model.layers.24.block_sparse_moe.switch_mlp.gate_proj": {
2367
+ "group_size": 64,
2368
+ "bits": 4
2369
+ },
2370
+ "model.layers.24.block_sparse_moe.switch_mlp.up_proj": {
2371
+ "group_size": 64,
2372
+ "bits": 2
2373
+ },
2374
+ "model.layers.24.block_sparse_moe.switch_mlp.down_proj": {
2375
+ "group_size": 64,
2376
+ "bits": 4
2377
+ },
2378
+ "model.layers.25.self_attn.q_proj": {
2379
+ "group_size": 64,
2380
+ "bits": 4
2381
+ },
2382
+ "model.layers.25.self_attn.k_proj": {
2383
+ "group_size": 64,
2384
+ "bits": 5
2385
+ },
2386
+ "model.layers.25.self_attn.v_proj": {
2387
+ "group_size": 64,
2388
+ "bits": 6
2389
+ },
2390
+ "model.layers.25.self_attn.o_proj": {
2391
+ "group_size": 64,
2392
+ "bits": 5
2393
+ },
2394
+ "model.layers.25.block_sparse_moe.gate": {
2395
+ "group_size": 64,
2396
+ "bits": 8
2397
+ },
2398
+ "model.layers.25.block_sparse_moe.switch_mlp.gate_proj": {
2399
+ "group_size": 64,
2400
+ "bits": 2
2401
+ },
2402
+ "model.layers.25.block_sparse_moe.switch_mlp.up_proj": {
2403
+ "group_size": 64,
2404
+ "bits": 2
2405
+ },
2406
+ "model.layers.25.block_sparse_moe.switch_mlp.down_proj": {
2407
+ "group_size": 64,
2408
+ "bits": 2
2409
+ },
2410
+ "model.layers.26.self_attn.q_proj": {
2411
+ "group_size": 64,
2412
+ "bits": 4
2413
+ },
2414
+ "model.layers.26.self_attn.k_proj": {
2415
+ "group_size": 64,
2416
+ "bits": 5
2417
+ },
2418
+ "model.layers.26.self_attn.v_proj": {
2419
+ "group_size": 64,
2420
+ "bits": 6
2421
+ },
2422
+ "model.layers.26.self_attn.o_proj": {
2423
+ "group_size": 64,
2424
+ "bits": 5
2425
+ },
2426
+ "model.layers.26.block_sparse_moe.gate": {
2427
+ "group_size": 64,
2428
+ "bits": 8
2429
+ },
2430
+ "model.layers.26.block_sparse_moe.switch_mlp.gate_proj": {
2431
+ "group_size": 64,
2432
+ "bits": 2
2433
+ },
2434
+ "model.layers.26.block_sparse_moe.switch_mlp.up_proj": {
2435
+ "group_size": 64,
2436
+ "bits": 2
2437
+ },
2438
+ "model.layers.26.block_sparse_moe.switch_mlp.down_proj": {
2439
+ "group_size": 64,
2440
+ "bits": 2
2441
+ },
2442
+ "model.layers.27.self_attn.q_proj": {
2443
+ "group_size": 64,
2444
+ "bits": 4
2445
+ },
2446
+ "model.layers.27.self_attn.k_proj": {
2447
+ "group_size": 64,
2448
+ "bits": 5
2449
+ },
2450
+ "model.layers.27.self_attn.v_proj": {
2451
+ "group_size": 64,
2452
+ "bits": 8
2453
+ },
2454
+ "model.layers.27.self_attn.o_proj": {
2455
+ "group_size": 64,
2456
+ "bits": 5
2457
+ },
2458
+ "model.layers.27.block_sparse_moe.gate": {
2459
+ "group_size": 64,
2460
+ "bits": 8
2461
+ },
2462
+ "model.layers.27.block_sparse_moe.switch_mlp.gate_proj": {
2463
+ "group_size": 64,
2464
+ "bits": 2
2465
+ },
2466
+ "model.layers.27.block_sparse_moe.switch_mlp.up_proj": {
2467
+ "group_size": 64,
2468
+ "bits": 2
2469
+ },
2470
+ "model.layers.27.block_sparse_moe.switch_mlp.down_proj": {
2471
+ "group_size": 64,
2472
+ "bits": 2
2473
+ },
2474
+ "model.layers.28.self_attn.q_proj": {
2475
+ "group_size": 64,
2476
+ "bits": 4
2477
+ },
2478
+ "model.layers.28.self_attn.k_proj": {
2479
+ "group_size": 64,
2480
+ "bits": 6
2481
+ },
2482
+ "model.layers.28.self_attn.v_proj": {
2483
+ "group_size": 64,
2484
+ "bits": 6
2485
+ },
2486
+ "model.layers.28.self_attn.o_proj": {
2487
+ "group_size": 64,
2488
+ "bits": 5
2489
+ },
2490
+ "model.layers.28.block_sparse_moe.gate": {
2491
+ "group_size": 64,
2492
+ "bits": 8
2493
+ },
2494
+ "model.layers.28.block_sparse_moe.switch_mlp.gate_proj": {
2495
+ "group_size": 64,
2496
+ "bits": 2
2497
+ },
2498
+ "model.layers.28.block_sparse_moe.switch_mlp.up_proj": {
2499
+ "group_size": 64,
2500
+ "bits": 2
2501
+ },
2502
+ "model.layers.28.block_sparse_moe.switch_mlp.down_proj": {
2503
+ "group_size": 64,
2504
+ "bits": 4
2505
+ },
2506
+ "model.layers.29.self_attn.q_proj": {
2507
+ "group_size": 64,
2508
+ "bits": 4
2509
+ },
2510
+ "model.layers.29.self_attn.k_proj": {
2511
+ "group_size": 64,
2512
+ "bits": 6
2513
+ },
2514
+ "model.layers.29.self_attn.v_proj": {
2515
+ "group_size": 64,
2516
+ "bits": 8
2517
+ },
2518
+ "model.layers.29.self_attn.o_proj": {
2519
+ "group_size": 64,
2520
+ "bits": 5
2521
+ },
2522
+ "model.layers.29.block_sparse_moe.switch_mlp.gate_proj": {
2523
+ "group_size": 64,
2524
+ "bits": 4
2525
+ },
2526
+ "model.layers.29.block_sparse_moe.switch_mlp.up_proj": {
2527
+ "group_size": 64,
2528
+ "bits": 2
2529
+ },
2530
+ "model.layers.29.block_sparse_moe.switch_mlp.down_proj": {
2531
+ "group_size": 64,
2532
+ "bits": 4
2533
+ },
2534
+ "model.layers.30.self_attn.q_proj": {
2535
+ "group_size": 64,
2536
+ "bits": 5
2537
+ },
2538
+ "model.layers.30.self_attn.k_proj": {
2539
+ "group_size": 64,
2540
+ "bits": 6
2541
+ },
2542
+ "model.layers.30.self_attn.v_proj": {
2543
+ "group_size": 64,
2544
+ "bits": 8
2545
+ },
2546
+ "model.layers.30.self_attn.o_proj": {
2547
+ "group_size": 64,
2548
+ "bits": 5
2549
+ },
2550
+ "model.layers.30.block_sparse_moe.gate": {
2551
+ "group_size": 64,
2552
+ "bits": 8
2553
+ },
2554
+ "model.layers.30.block_sparse_moe.switch_mlp.gate_proj": {
2555
+ "group_size": 64,
2556
+ "bits": 2
2557
+ },
2558
+ "model.layers.30.block_sparse_moe.switch_mlp.up_proj": {
2559
+ "group_size": 64,
2560
+ "bits": 2
2561
+ },
2562
+ "model.layers.30.block_sparse_moe.switch_mlp.down_proj": {
2563
+ "group_size": 64,
2564
+ "bits": 4
2565
+ },
2566
+ "model.layers.31.self_attn.q_proj": {
2567
+ "group_size": 64,
2568
+ "bits": 4
2569
+ },
2570
+ "model.layers.31.self_attn.k_proj": {
2571
+ "group_size": 64,
2572
+ "bits": 6
2573
+ },
2574
+ "model.layers.31.self_attn.v_proj": {
2575
+ "group_size": 64,
2576
+ "bits": 8
2577
+ },
2578
+ "model.layers.31.self_attn.o_proj": {
2579
+ "group_size": 64,
2580
+ "bits": 5
2581
+ },
2582
+ "model.layers.31.block_sparse_moe.gate": {
2583
+ "group_size": 64,
2584
+ "bits": 8
2585
+ },
2586
+ "model.layers.31.block_sparse_moe.switch_mlp.gate_proj": {
2587
+ "group_size": 64,
2588
+ "bits": 2
2589
+ },
2590
+ "model.layers.31.block_sparse_moe.switch_mlp.up_proj": {
2591
+ "group_size": 64,
2592
+ "bits": 2
2593
+ },
2594
+ "model.layers.31.block_sparse_moe.switch_mlp.down_proj": {
2595
+ "group_size": 64,
2596
+ "bits": 4
2597
+ },
2598
+ "model.layers.32.self_attn.q_proj": {
2599
+ "group_size": 64,
2600
+ "bits": 5
2601
+ },
2602
+ "model.layers.32.self_attn.k_proj": {
2603
+ "group_size": 64,
2604
+ "bits": 6
2605
+ },
2606
+ "model.layers.32.self_attn.v_proj": {
2607
+ "group_size": 64,
2608
+ "bits": 8
2609
+ },
2610
+ "model.layers.32.self_attn.o_proj": {
2611
+ "group_size": 64,
2612
+ "bits": 5
2613
+ },
2614
+ "model.layers.32.block_sparse_moe.switch_mlp.gate_proj": {
2615
+ "group_size": 64,
2616
+ "bits": 4
2617
+ },
2618
+ "model.layers.32.block_sparse_moe.switch_mlp.up_proj": {
2619
+ "group_size": 64,
2620
+ "bits": 2
2621
+ },
2622
+ "model.layers.32.block_sparse_moe.switch_mlp.down_proj": {
2623
+ "group_size": 64,
2624
+ "bits": 4
2625
+ },
2626
+ "model.layers.33.self_attn.q_proj": {
2627
+ "group_size": 64,
2628
+ "bits": 5
2629
+ },
2630
+ "model.layers.33.self_attn.k_proj": {
2631
+ "group_size": 64,
2632
+ "bits": 6
2633
+ },
2634
+ "model.layers.33.self_attn.v_proj": {
2635
+ "group_size": 64,
2636
+ "bits": 8
2637
+ },
2638
+ "model.layers.33.self_attn.o_proj": {
2639
+ "group_size": 64,
2640
+ "bits": 5
2641
+ },
2642
+ "model.layers.33.block_sparse_moe.gate": {
2643
+ "group_size": 64,
2644
+ "bits": 8
2645
+ },
2646
+ "model.layers.33.block_sparse_moe.switch_mlp.gate_proj": {
2647
+ "group_size": 64,
2648
+ "bits": 4
2649
+ },
2650
+ "model.layers.33.block_sparse_moe.switch_mlp.up_proj": {
2651
+ "group_size": 64,
2652
+ "bits": 4
2653
+ },
2654
+ "model.layers.33.block_sparse_moe.switch_mlp.down_proj": {
2655
+ "group_size": 64,
2656
+ "bits": 4
2657
+ },
2658
+ "model.layers.34.self_attn.q_proj": {
2659
+ "group_size": 64,
2660
+ "bits": 5
2661
+ },
2662
+ "model.layers.34.self_attn.k_proj": {
2663
+ "group_size": 64,
2664
+ "bits": 6
2665
+ },
2666
+ "model.layers.34.self_attn.v_proj": {
2667
+ "group_size": 64,
2668
+ "bits": 8
2669
+ },
2670
+ "model.layers.34.self_attn.o_proj": {
2671
+ "group_size": 64,
2672
+ "bits": 5
2673
+ },
2674
+ "model.layers.34.block_sparse_moe.gate": {
2675
+ "group_size": 64,
2676
+ "bits": 8
2677
+ },
2678
+ "model.layers.34.block_sparse_moe.switch_mlp.gate_proj": {
2679
+ "group_size": 64,
2680
+ "bits": 2
2681
+ },
2682
+ "model.layers.34.block_sparse_moe.switch_mlp.up_proj": {
2683
+ "group_size": 64,
2684
+ "bits": 2
2685
+ },
2686
+ "model.layers.34.block_sparse_moe.switch_mlp.down_proj": {
2687
+ "group_size": 64,
2688
+ "bits": 2
2689
+ },
2690
+ "model.layers.35.self_attn.q_proj": {
2691
+ "group_size": 64,
2692
+ "bits": 5
2693
+ },
2694
+ "model.layers.35.self_attn.k_proj": {
2695
+ "group_size": 64,
2696
+ "bits": 6
2697
+ },
2698
+ "model.layers.35.self_attn.v_proj": {
2699
+ "group_size": 64,
2700
+ "bits": 8
2701
+ },
2702
+ "model.layers.35.self_attn.o_proj": {
2703
+ "group_size": 64,
2704
+ "bits": 6
2705
+ },
2706
+ "model.layers.35.block_sparse_moe.switch_mlp.gate_proj": {
2707
+ "group_size": 64,
2708
+ "bits": 2
2709
+ },
2710
+ "model.layers.35.block_sparse_moe.switch_mlp.up_proj": {
2711
+ "group_size": 64,
2712
+ "bits": 2
2713
+ },
2714
+ "model.layers.35.block_sparse_moe.switch_mlp.down_proj": {
2715
+ "group_size": 64,
2716
+ "bits": 4
2717
+ },
2718
+ "model.layers.36.self_attn.q_proj": {
2719
+ "group_size": 64,
2720
+ "bits": 4
2721
+ },
2722
+ "model.layers.36.self_attn.k_proj": {
2723
+ "group_size": 64,
2724
+ "bits": 6
2725
+ },
2726
+ "model.layers.36.self_attn.v_proj": {
2727
+ "group_size": 64,
2728
+ "bits": 8
2729
+ },
2730
+ "model.layers.36.self_attn.o_proj": {
2731
+ "group_size": 64,
2732
+ "bits": 6
2733
+ },
2734
+ "model.layers.36.block_sparse_moe.switch_mlp.gate_proj": {
2735
+ "group_size": 64,
2736
+ "bits": 4
2737
+ },
2738
+ "model.layers.36.block_sparse_moe.switch_mlp.up_proj": {
2739
+ "group_size": 64,
2740
+ "bits": 4
2741
+ },
2742
+ "model.layers.36.block_sparse_moe.switch_mlp.down_proj": {
2743
+ "group_size": 64,
2744
+ "bits": 4
2745
+ },
2746
+ "model.layers.37.self_attn.q_proj": {
2747
+ "group_size": 64,
2748
+ "bits": 5
2749
+ },
2750
+ "model.layers.37.self_attn.k_proj": {
2751
+ "group_size": 64,
2752
+ "bits": 6
2753
+ },
2754
+ "model.layers.37.self_attn.v_proj": {
2755
+ "group_size": 64,
2756
+ "bits": 8
2757
+ },
2758
+ "model.layers.37.self_attn.o_proj": {
2759
+ "group_size": 64,
2760
+ "bits": 6
2761
+ },
2762
+ "model.layers.37.block_sparse_moe.gate": {
2763
+ "group_size": 64,
2764
+ "bits": 8
2765
+ },
2766
+ "model.layers.37.block_sparse_moe.switch_mlp.gate_proj": {
2767
+ "group_size": 64,
2768
+ "bits": 4
2769
+ },
2770
+ "model.layers.37.block_sparse_moe.switch_mlp.up_proj": {
2771
+ "group_size": 64,
2772
+ "bits": 4
2773
+ },
2774
+ "model.layers.37.block_sparse_moe.switch_mlp.down_proj": {
2775
+ "group_size": 64,
2776
+ "bits": 4
2777
+ },
2778
+ "model.layers.38.self_attn.q_proj": {
2779
+ "group_size": 64,
2780
+ "bits": 5
2781
+ },
2782
+ "model.layers.38.self_attn.k_proj": {
2783
+ "group_size": 64,
2784
+ "bits": 6
2785
+ },
2786
+ "model.layers.38.self_attn.v_proj": {
2787
+ "group_size": 64,
2788
+ "bits": 8
2789
+ },
2790
+ "model.layers.38.self_attn.o_proj": {
2791
+ "group_size": 64,
2792
+ "bits": 6
2793
+ },
2794
+ "model.layers.38.block_sparse_moe.switch_mlp.gate_proj": {
2795
+ "group_size": 64,
2796
+ "bits": 4
2797
+ },
2798
+ "model.layers.38.block_sparse_moe.switch_mlp.up_proj": {
2799
+ "group_size": 64,
2800
+ "bits": 2
2801
+ },
2802
+ "model.layers.38.block_sparse_moe.switch_mlp.down_proj": {
2803
+ "group_size": 64,
2804
+ "bits": 2
2805
+ },
2806
+ "model.layers.39.self_attn.q_proj": {
2807
+ "group_size": 64,
2808
+ "bits": 5
2809
+ },
2810
+ "model.layers.39.self_attn.k_proj": {
2811
+ "group_size": 64,
2812
+ "bits": 8
2813
+ },
2814
+ "model.layers.39.self_attn.v_proj": {
2815
+ "group_size": 64,
2816
+ "bits": 8
2817
+ },
2818
+ "model.layers.39.self_attn.o_proj": {
2819
+ "group_size": 64,
2820
+ "bits": 6
2821
+ },
2822
+ "model.layers.39.block_sparse_moe.switch_mlp.gate_proj": {
2823
+ "group_size": 64,
2824
+ "bits": 4
2825
+ },
2826
+ "model.layers.39.block_sparse_moe.switch_mlp.up_proj": {
2827
+ "group_size": 64,
2828
+ "bits": 4
2829
+ },
2830
+ "model.layers.39.block_sparse_moe.switch_mlp.down_proj": {
2831
+ "group_size": 64,
2832
+ "bits": 4
2833
+ },
2834
+ "model.layers.40.self_attn.q_proj": {
2835
+ "group_size": 64,
2836
+ "bits": 5
2837
+ },
2838
+ "model.layers.40.self_attn.k_proj": {
2839
+ "group_size": 64,
2840
+ "bits": 6
2841
+ },
2842
+ "model.layers.40.self_attn.v_proj": {
2843
+ "group_size": 64,
2844
+ "bits": 8
2845
+ },
2846
+ "model.layers.40.self_attn.o_proj": {
2847
+ "group_size": 64,
2848
+ "bits": 6
2849
+ },
2850
+ "model.layers.40.block_sparse_moe.switch_mlp.gate_proj": {
2851
+ "group_size": 64,
2852
+ "bits": 4
2853
+ },
2854
+ "model.layers.40.block_sparse_moe.switch_mlp.up_proj": {
2855
+ "group_size": 64,
2856
+ "bits": 4
2857
+ },
2858
+ "model.layers.40.block_sparse_moe.switch_mlp.down_proj": {
2859
+ "group_size": 64,
2860
+ "bits": 4
2861
+ },
2862
+ "model.layers.41.self_attn.q_proj": {
2863
+ "group_size": 64,
2864
+ "bits": 5
2865
+ },
2866
+ "model.layers.41.self_attn.k_proj": {
2867
+ "group_size": 64,
2868
+ "bits": 6
2869
+ },
2870
+ "model.layers.41.self_attn.v_proj": {
2871
+ "group_size": 64,
2872
+ "bits": 8
2873
+ },
2874
+ "model.layers.41.self_attn.o_proj": {
2875
+ "group_size": 64,
2876
+ "bits": 6
2877
+ },
2878
+ "model.layers.41.block_sparse_moe.switch_mlp.gate_proj": {
2879
+ "group_size": 64,
2880
+ "bits": 4
2881
+ },
2882
+ "model.layers.41.block_sparse_moe.switch_mlp.up_proj": {
2883
+ "group_size": 64,
2884
+ "bits": 4
2885
+ },
2886
+ "model.layers.41.block_sparse_moe.switch_mlp.down_proj": {
2887
+ "group_size": 64,
2888
+ "bits": 4
2889
+ },
2890
+ "model.layers.42.self_attn.q_proj": {
2891
+ "group_size": 64,
2892
+ "bits": 6
2893
+ },
2894
+ "model.layers.42.self_attn.k_proj": {
2895
+ "group_size": 64,
2896
+ "bits": 8
2897
+ },
2898
+ "model.layers.42.self_attn.v_proj": {
2899
+ "group_size": 64,
2900
+ "bits": 8
2901
+ },
2902
+ "model.layers.42.self_attn.o_proj": {
2903
+ "group_size": 64,
2904
+ "bits": 6
2905
+ },
2906
+ "model.layers.42.block_sparse_moe.switch_mlp.gate_proj": {
2907
+ "group_size": 64,
2908
+ "bits": 4
2909
+ },
2910
+ "model.layers.42.block_sparse_moe.switch_mlp.up_proj": {
2911
+ "group_size": 64,
2912
+ "bits": 4
2913
+ },
2914
+ "model.layers.42.block_sparse_moe.switch_mlp.down_proj": {
2915
+ "group_size": 64,
2916
+ "bits": 4
2917
+ },
2918
+ "model.layers.43.self_attn.q_proj": {
2919
+ "group_size": 64,
2920
+ "bits": 5
2921
+ },
2922
+ "model.layers.43.self_attn.k_proj": {
2923
+ "group_size": 64,
2924
+ "bits": 8
2925
+ },
2926
+ "model.layers.43.self_attn.v_proj": {
2927
+ "group_size": 64,
2928
+ "bits": 8
2929
+ },
2930
+ "model.layers.43.self_attn.o_proj": {
2931
+ "group_size": 64,
2932
+ "bits": 6
2933
+ },
2934
+ "model.layers.43.block_sparse_moe.switch_mlp.gate_proj": {
2935
+ "group_size": 64,
2936
+ "bits": 4
2937
+ },
2938
+ "model.layers.43.block_sparse_moe.switch_mlp.up_proj": {
2939
+ "group_size": 64,
2940
+ "bits": 4
2941
+ },
2942
+ "model.layers.43.block_sparse_moe.switch_mlp.down_proj": {
2943
+ "group_size": 64,
2944
+ "bits": 4
2945
+ },
2946
+ "model.layers.44.self_attn.q_proj": {
2947
+ "group_size": 64,
2948
+ "bits": 6
2949
+ },
2950
+ "model.layers.44.self_attn.k_proj": {
2951
+ "group_size": 64,
2952
+ "bits": 8
2953
+ },
2954
+ "model.layers.44.self_attn.v_proj": {
2955
+ "group_size": 64,
2956
+ "bits": 8
2957
+ },
2958
+ "model.layers.44.self_attn.o_proj": {
2959
+ "group_size": 64,
2960
+ "bits": 6
2961
+ },
2962
+ "model.layers.44.block_sparse_moe.switch_mlp.gate_proj": {
2963
+ "group_size": 64,
2964
+ "bits": 4
2965
+ },
2966
+ "model.layers.44.block_sparse_moe.switch_mlp.up_proj": {
2967
+ "group_size": 64,
2968
+ "bits": 4
2969
+ },
2970
+ "model.layers.44.block_sparse_moe.switch_mlp.down_proj": {
2971
+ "group_size": 64,
2972
+ "bits": 4
2973
+ },
2974
+ "model.layers.45.block_sparse_moe.switch_mlp.gate_proj": {
2975
+ "group_size": 64,
2976
+ "bits": 5
2977
+ },
2978
+ "model.layers.45.block_sparse_moe.switch_mlp.up_proj": {
2979
+ "group_size": 64,
2980
+ "bits": 5
2981
+ },
2982
+ "model.layers.45.block_sparse_moe.switch_mlp.down_proj": {
2983
+ "group_size": 64,
2984
+ "bits": 5
2985
+ },
2986
+ "model.layers.46.block_sparse_moe.switch_mlp.gate_proj": {
2987
+ "group_size": 64,
2988
+ "bits": 5
2989
+ },
2990
+ "model.layers.46.block_sparse_moe.switch_mlp.up_proj": {
2991
+ "group_size": 64,
2992
+ "bits": 5
2993
+ },
2994
+ "model.layers.46.block_sparse_moe.switch_mlp.down_proj": {
2995
+ "group_size": 64,
2996
+ "bits": 5
2997
+ },
2998
+ "model.layers.47.block_sparse_moe.switch_mlp.gate_proj": {
2999
+ "group_size": 64,
3000
+ "bits": 5
3001
+ },
3002
+ "model.layers.47.block_sparse_moe.switch_mlp.up_proj": {
3003
+ "group_size": 64,
3004
+ "bits": 5
3005
+ },
3006
+ "model.layers.47.block_sparse_moe.switch_mlp.down_proj": {
3007
+ "group_size": 64,
3008
+ "bits": 5
3009
+ },
3010
+ "model.layers.48.block_sparse_moe.switch_mlp.gate_proj": {
3011
+ "group_size": 64,
3012
+ "bits": 5
3013
+ },
3014
+ "model.layers.48.block_sparse_moe.switch_mlp.up_proj": {
3015
+ "group_size": 64,
3016
+ "bits": 5
3017
+ },
3018
+ "model.layers.48.block_sparse_moe.switch_mlp.down_proj": {
3019
+ "group_size": 64,
3020
+ "bits": 5
3021
+ },
3022
+ "model.layers.49.block_sparse_moe.switch_mlp.gate_proj": {
3023
+ "group_size": 64,
3024
+ "bits": 5
3025
+ },
3026
+ "model.layers.49.block_sparse_moe.switch_mlp.up_proj": {
3027
+ "group_size": 64,
3028
+ "bits": 5
3029
+ },
3030
+ "model.layers.49.block_sparse_moe.switch_mlp.down_proj": {
3031
+ "group_size": 64,
3032
+ "bits": 5
3033
+ },
3034
+ "model.layers.50.block_sparse_moe.switch_mlp.gate_proj": {
3035
+ "group_size": 64,
3036
+ "bits": 5
3037
+ },
3038
+ "model.layers.50.block_sparse_moe.switch_mlp.up_proj": {
3039
+ "group_size": 64,
3040
+ "bits": 5
3041
+ },
3042
+ "model.layers.50.block_sparse_moe.switch_mlp.down_proj": {
3043
+ "group_size": 64,
3044
+ "bits": 5
3045
+ },
3046
+ "model.layers.51.block_sparse_moe.switch_mlp.gate_proj": {
3047
+ "group_size": 64,
3048
+ "bits": 5
3049
+ },
3050
+ "model.layers.51.block_sparse_moe.switch_mlp.up_proj": {
3051
+ "group_size": 64,
3052
+ "bits": 5
3053
+ },
3054
+ "model.layers.51.block_sparse_moe.switch_mlp.down_proj": {
3055
+ "group_size": 64,
3056
+ "bits": 5
3057
+ },
3058
+ "model.layers.52.block_sparse_moe.switch_mlp.gate_proj": {
3059
+ "group_size": 64,
3060
+ "bits": 5
3061
+ },
3062
+ "model.layers.52.block_sparse_moe.switch_mlp.up_proj": {
3063
+ "group_size": 64,
3064
+ "bits": 5
3065
+ },
3066
+ "model.layers.52.block_sparse_moe.switch_mlp.down_proj": {
3067
+ "group_size": 64,
3068
+ "bits": 5
3069
+ },
3070
+ "model.layers.53.block_sparse_moe.switch_mlp.gate_proj": {
3071
+ "group_size": 64,
3072
+ "bits": 5
3073
+ },
3074
+ "model.layers.53.block_sparse_moe.switch_mlp.up_proj": {
3075
+ "group_size": 64,
3076
+ "bits": 5
3077
+ },
3078
+ "model.layers.53.block_sparse_moe.switch_mlp.down_proj": {
3079
+ "group_size": 64,
3080
+ "bits": 6
3081
+ },
3082
+ "model.layers.54.block_sparse_moe.switch_mlp.gate_proj": {
3083
+ "group_size": 64,
3084
+ "bits": 6
3085
+ },
3086
+ "model.layers.54.block_sparse_moe.switch_mlp.up_proj": {
3087
+ "group_size": 64,
3088
+ "bits": 6
3089
+ },
3090
+ "model.layers.54.block_sparse_moe.switch_mlp.down_proj": {
3091
+ "group_size": 64,
3092
+ "bits": 6
3093
+ },
3094
+ "model.layers.55.block_sparse_moe.switch_mlp.gate_proj": {
3095
+ "group_size": 64,
3096
+ "bits": 6
3097
+ },
3098
+ "model.layers.55.block_sparse_moe.switch_mlp.up_proj": {
3099
+ "group_size": 64,
3100
+ "bits": 6
3101
+ },
3102
+ "model.layers.55.block_sparse_moe.switch_mlp.down_proj": {
3103
+ "group_size": 64,
3104
+ "bits": 6
3105
+ },
3106
+ "model.layers.56.block_sparse_moe.switch_mlp.gate_proj": {
3107
+ "group_size": 64,
3108
+ "bits": 6
3109
+ },
3110
+ "model.layers.56.block_sparse_moe.switch_mlp.up_proj": {
3111
+ "group_size": 64,
3112
+ "bits": 6
3113
+ },
3114
+ "model.layers.56.block_sparse_moe.switch_mlp.down_proj": {
3115
+ "group_size": 64,
3116
+ "bits": 6
3117
+ },
3118
+ "model.layers.57.block_sparse_moe.switch_mlp.gate_proj": {
3119
+ "group_size": 64,
3120
+ "bits": 6
3121
+ },
3122
+ "model.layers.57.block_sparse_moe.switch_mlp.up_proj": {
3123
+ "group_size": 64,
3124
+ "bits": 6
3125
+ },
3126
+ "model.layers.57.block_sparse_moe.switch_mlp.down_proj": {
3127
+ "group_size": 64,
3128
+ "bits": 6
3129
+ },
3130
+ "model.layers.58.block_sparse_moe.switch_mlp.gate_proj": {
3131
+ "group_size": 64,
3132
+ "bits": 6
3133
+ },
3134
+ "model.layers.58.block_sparse_moe.switch_mlp.up_proj": {
3135
+ "group_size": 64,
3136
+ "bits": 6
3137
+ },
3138
+ "model.layers.58.block_sparse_moe.switch_mlp.down_proj": {
3139
+ "group_size": 64,
3140
+ "bits": 6
3141
+ },
3142
+ "model.layers.59.block_sparse_moe.switch_mlp.gate_proj": {
3143
+ "group_size": 64,
3144
+ "bits": 6
3145
+ },
3146
+ "model.layers.59.block_sparse_moe.switch_mlp.up_proj": {
3147
+ "group_size": 64,
3148
+ "bits": 6
3149
+ },
3150
+ "model.layers.59.block_sparse_moe.switch_mlp.down_proj": {
3151
+ "group_size": 64,
3152
+ "bits": 6
3153
+ },
3154
+ "model.layers.60.block_sparse_moe.switch_mlp.gate_proj": {
3155
+ "group_size": 64,
3156
+ "bits": 5
3157
+ },
3158
+ "model.layers.60.block_sparse_moe.switch_mlp.up_proj": {
3159
+ "group_size": 64,
3160
+ "bits": 5
3161
+ },
3162
+ "model.layers.60.block_sparse_moe.switch_mlp.down_proj": {
3163
+ "group_size": 64,
3164
+ "bits": 5
3165
+ },
3166
+ "model.layers.61.block_sparse_moe.switch_mlp.gate_proj": {
3167
+ "group_size": 64,
3168
+ "bits": 6
3169
+ },
3170
+ "model.layers.61.block_sparse_moe.switch_mlp.up_proj": {
3171
+ "group_size": 64,
3172
+ "bits": 8
3173
+ },
3174
+ "model.layers.61.block_sparse_moe.switch_mlp.down_proj": {
3175
+ "group_size": 64,
3176
+ "bits": 6
3177
+ }
3178
+ },
3179
+ "rms_norm_eps": 1e-06,
3180
+ "rope_theta": 5000000,
3181
+ "rotary_dim": 64,
3182
+ "scoring_func": "sigmoid",
3183
+ "shared_intermediate_size": 0,
3184
+ "tie_word_embeddings": false,
3185
+ "transformers_version": "4.46.1",
3186
+ "use_cache": true,
3187
+ "use_mtp": true,
3188
+ "use_qk_norm": true,
3189
+ "use_routing_bias": true,
3190
+ "vocab_size": 200064
3191
+ }
configuration_minimax_m2.py ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
2
+ # This file was automatically generated from src/transformers/models/minimax_m2/modular_minimax_m2.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_minimax_m2.py file directly. One of our CI enforces this.
6
+ # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
7
+ # coding=utf-8
8
+ # Copyright 2025 the HuggingFace Team. All rights reserved.
9
+ #
10
+ # Licensed under the Apache License, Version 2.0 (the "License");
11
+ # you may not use this file except in compliance with the License.
12
+ # You may obtain a copy of the License at
13
+ #
14
+ # http://www.apache.org/licenses/LICENSE-2.0
15
+ #
16
+ # Unless required by applicable law or agreed to in writing, software
17
+ # distributed under the License is distributed on an "AS IS" BASIS,
18
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ # See the License for the specific language governing permissions and
20
+ # limitations under the License.
21
+
22
+
23
+ from transformers.configuration_utils import PretrainedConfig
24
+
25
+
26
+ class MiniMaxM2Config(PretrainedConfig):
27
+ r"""
28
+ This is the configuration class to store the configuration of a [`MiniMaxM2Model`]. It is used to instantiate an
29
+ MiniMaxM2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
30
+ with the defaults will yield a similar configuration to that of the MiniMaxM2-7B-v0.1 or MiniMaxM2-7B-Instruct-v0.1.
31
+
32
+ [minimax_m2ai/MiniMaxM2-8x7B](https://huggingface.co/minimax_m2ai/MiniMaxM2-8x7B)
33
+ [minimax_m2ai/MiniMaxM2-7B-Instruct-v0.1](https://huggingface.co/minimax_m2ai/MiniMaxM2-7B-Instruct-v0.1)
34
+
35
+ Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
36
+ documentation from [`PretrainedConfig`] for more information.
37
+
38
+
39
+ Args:
40
+ vocab_size (`int`, *optional*, defaults to 32000):
41
+ Vocabulary size of the MiniMaxM2 model. Defines the number of different tokens that can be represented by the
42
+ `inputs_ids` passed when calling [`MiniMaxM2Model`]
43
+ hidden_size (`int`, *optional*, defaults to 4096):
44
+ Dimension of the hidden representations.
45
+ intermediate_size (`int`, *optional*, defaults to 14336):
46
+ Dimension of the MLP representations.
47
+ num_hidden_layers (`int`, *optional*, defaults to 32):
48
+ Number of hidden layers in the Transformer encoder.
49
+ num_attention_heads (`int`, *optional*, defaults to 32):
50
+ Number of attention heads for each attention layer in the Transformer encoder.
51
+ num_key_value_heads (`int`, *optional*, defaults to 8):
52
+ This is the number of key_value heads that should be used to implement Grouped Query Attention. If
53
+ `num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
54
+ `num_key_value_heads=1` the model will use Multi Query Attention (MQA) otherwise GQA is used. When
55
+ converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
56
+ by meanpooling all the original heads within that group. For more details, check out [this
57
+ paper](https://huggingface.co/papers/2305.13245). If it is not specified, will default to `8`.
58
+ head_dim (`int`, *optional*, defaults to `hidden_size // num_attention_heads`):
59
+ The attention head dimension.
60
+ hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
61
+ The non-linear activation function (function or string) in the decoder.
62
+ max_position_embeddings (`int`, *optional*, defaults to `4096*32`):
63
+ The maximum sequence length that this model might ever be used with. MiniMaxM2's sliding window attention
64
+ allows sequence of up to 4096*32 tokens.
65
+ initializer_range (`float`, *optional*, defaults to 0.02):
66
+ The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
67
+ rms_norm_eps (`float`, *optional*, defaults to 1e-05):
68
+ The epsilon used by the rms normalization layers.
69
+ use_cache (`bool`, *optional*, defaults to `True`):
70
+ Whether or not the model should return the last key/values attentions (not used by all models). Only
71
+ relevant if `config.is_decoder=True`.
72
+ pad_token_id (`int`, *optional*):
73
+ The id of the padding token.
74
+ bos_token_id (`int`, *optional*, defaults to 1):
75
+ The id of the "beginning-of-sequence" token.
76
+ eos_token_id (`int`, *optional*, defaults to 2):
77
+ The id of the "end-of-sequence" token.
78
+ tie_word_embeddings (`bool`, *optional*, defaults to `False`):
79
+ Whether the model's input and output word embeddings should be tied.
80
+ rope_theta (`float`, *optional*, defaults to 1000000.0):
81
+ The base period of the RoPE embeddings.
82
+ sliding_window (`int`, *optional*):
83
+ Sliding window attention window size. If not specified, will default to `4096`.
84
+ attention_dropout (`float`, *optional*, defaults to 0.0):
85
+ The dropout ratio for the attention probabilities.
86
+ num_experts_per_tok (`int`, *optional*, defaults to 2):
87
+ The number of experts to route per-token, can be also interpreted as the `top-k` routing
88
+ parameter
89
+ num_local_experts (`int`, *optional*, defaults to 8):
90
+ Number of experts per Sparse MLP layer.
91
+ output_router_logits (`bool`, *optional*, defaults to `False`):
92
+ Whether or not the router logits should be returned by the model. Enabling this will also
93
+ allow the model to output the auxiliary loss. See [here]() for more details
94
+ router_aux_loss_coef (`float`, *optional*, defaults to 0.001):
95
+ The aux loss factor for the total loss.
96
+ router_jitter_noise (`float`, *optional*, defaults to 0.0):
97
+ Amount of noise to add to the router.
98
+
99
+ ```python
100
+ >>> from transformers import MiniMaxM2Model, MiniMaxM2Config
101
+
102
+ >>> # Initializing a MiniMaxM2 7B style configuration
103
+ >>> configuration = MiniMaxM2Config()
104
+
105
+ >>> # Initializing a model from the MiniMaxM2 7B style configuration
106
+ >>> model = MiniMaxM2Model(configuration)
107
+
108
+ >>> # Accessing the model configuration
109
+ >>> configuration = model.config
110
+ ```"""
111
+
112
+ model_type = "minimax_m2"
113
+ keys_to_ignore_at_inference = ["past_key_values"]
114
+ base_model_tp_plan = {
115
+ "layers.*.self_attn.q_proj": "colwise",
116
+ "layers.*.self_attn.k_proj": "colwise",
117
+ "layers.*.self_attn.v_proj": "colwise",
118
+ "layers.*.self_attn.o_proj": "rowwise",
119
+ "layers.*.block_sparse_moe.gate": "colwise_rep", # we need to replicate here to correctly route experts
120
+ "layers.*.block_sparse_moe.experts.*.w1": "colwise",
121
+ "layers.*.block_sparse_moe.experts.*.w2": "rowwise",
122
+ "layers.*.block_sparse_moe.experts.*.w3": "colwise",
123
+ }
124
+ base_model_pp_plan = {
125
+ "embed_tokens": (["input_ids"], ["inputs_embeds"]),
126
+ "layers": (["hidden_states", "attention_mask"], ["hidden_states"]),
127
+ "norm": (["hidden_states"], ["hidden_states"]),
128
+ }
129
+
130
+ def __init__(
131
+ self,
132
+ vocab_size=32000,
133
+ hidden_size=4096,
134
+ intermediate_size=14336,
135
+ num_hidden_layers=32,
136
+ num_attention_heads=32,
137
+ num_key_value_heads=8,
138
+ head_dim=None,
139
+ hidden_act="silu",
140
+ max_position_embeddings=4096 * 32,
141
+ initializer_range=0.02,
142
+ rms_norm_eps=1e-5,
143
+ use_cache=True,
144
+ pad_token_id=None,
145
+ bos_token_id=1,
146
+ eos_token_id=2,
147
+ tie_word_embeddings=False,
148
+ rope_theta=1e6,
149
+ sliding_window=None,
150
+ attention_dropout=0.0,
151
+ num_experts_per_tok=2,
152
+ num_local_experts=8,
153
+ output_router_logits=False,
154
+ router_aux_loss_coef=0.001,
155
+ router_jitter_noise=0.0,
156
+ **kwargs,
157
+ ):
158
+ self.vocab_size = vocab_size
159
+ self.max_position_embeddings = max_position_embeddings
160
+ self.hidden_size = hidden_size
161
+ self.intermediate_size = intermediate_size
162
+ self.num_hidden_layers = num_hidden_layers
163
+ self.num_attention_heads = num_attention_heads
164
+ self.sliding_window = sliding_window
165
+
166
+ # for backward compatibility
167
+ if num_key_value_heads is None:
168
+ num_key_value_heads = num_attention_heads
169
+
170
+ self.num_key_value_heads = num_key_value_heads
171
+ self.hidden_act = hidden_act
172
+ self.initializer_range = initializer_range
173
+ self.rms_norm_eps = rms_norm_eps
174
+ self.use_cache = use_cache
175
+ self.rope_theta = rope_theta
176
+ self.attention_dropout = attention_dropout
177
+ self.head_dim = head_dim
178
+
179
+ self.num_experts_per_tok = num_experts_per_tok
180
+ self.num_local_experts = num_local_experts
181
+ self.output_router_logits = output_router_logits
182
+ self.router_aux_loss_coef = router_aux_loss_coef
183
+ self.router_jitter_noise = router_jitter_noise
184
+
185
+ self.use_qk_norm = kwargs.pop("use_qk_norm", False)
186
+ self.rotary_dim = kwargs.pop("rotary_dim", self.head_dim)
187
+ self.partial_rotary_factor = kwargs.pop("partial_rotary_factor", 1)
188
+ if self.head_dim is not None:
189
+ self.partial_rotary_factor = self.rotary_dim / self.head_dim
190
+
191
+ super().__init__(
192
+ pad_token_id=pad_token_id,
193
+ bos_token_id=bos_token_id,
194
+ eos_token_id=eos_token_id,
195
+ tie_word_embeddings=tie_word_embeddings,
196
+ **kwargs,
197
+ )
198
+
199
+
200
+ __all__ = ["MiniMaxM2Config"]
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 200019,
3
+ "do_sample": true,
4
+ "eos_token_id": 200020,
5
+ "temperature": 1.0,
6
+ "top_p": 0.95,
7
+ "top_k": 40,
8
+ "transformers_version": "4.46.1"
9
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model-00001-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a4e030991e59c34c0c2ef97b3ad1bc24198234b86001f10d2334ebb745123ec
3
+ size 5349357934
model-00002-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2391364541f795d0e674e4e1a23b8a40284ebc59f723699f0adb5315f14a9bc
3
+ size 5350189990
model-00003-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce74bd8e1c4ef7a257b8f5bde6d806fd3d84ee713ecfb3bc872d4e9c05c5884c
3
+ size 4960905720
model-00004-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c880e62f0fc2fcaf6c6ad3fd0dc5cd24f7d0791a80c38112dae100ecc3eb8b4
3
+ size 5203422283
model-00005-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96cd4a207be0f30ce34f495371eca8ca4031b10c50847c5ddca0755dafa033b1
3
+ size 5365230396
model-00006-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:359e37ca609598b875080ba124333985409acbd32c2894ef80a55695de06113a
3
+ size 5309720815
model-00007-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:faebf3a700673df42727509deec14df143d6120df53ba5aa073e69b85727bae6
3
+ size 5349337607
model-00008-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce1493a6d044b27c735b1e14ed061e6e81015e84e99b1ed059931a6cb30d587a
3
+ size 5209351682
model-00009-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2df7db84c1ca53c4f51937c721ef820c425a8fb00cf0648583d06a6bbe320a5
3
+ size 5255358276
model-00010-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f970ec3d1b9abeab2d4910419203075a959e6d9dec9b8f2b3b693c9e638bafcf
3
+ size 5345275507
model-00011-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:220e38866900c862dbc68cda2eac6fedb019dc53d16e0acda1a0f667b6f02933
3
+ size 4781040111
model-00012-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ed37738b9744dc9fcc5e6180e8e6961dc8b30270f897e8d57eafc2f15382074
3
+ size 5206341259
model-00013-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd04821aa9a5f5d89fb531f0b4c4568010f6728562ac36dc87437840b0e3ea86
3
+ size 5246773686
model-00014-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac4b9cff644837c747f6b8fba7c1d46f5665a9e31fe932b5c018b7f93a47e0ef
3
+ size 4835046361
model-00015-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:444cb21db15c8c14a3b9cbacbbd07c31949d570fc889b4177bead11268dd4879
3
+ size 5341128105
model-00016-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fad340e97063ab5f44ccdc4563f7070022faf32e4412a81ea03757d5a3eb11ee
3
+ size 5256586823
model-00017-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1cc8e67b1f10eddd7f63e4b20a2ea2d17a96b82f8cedee415d05f80608aea14e
3
+ size 5165345540
model-00018-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c96c20e36759fae75813a07b716e0854c11d53eceb902ad2f68e0241821429d1
3
+ size 5165345538
model-00019-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d1064a1ea688f74859bb15dd05271da50143f08884f622feebca9247f808079
3
+ size 5316340478
model-00020-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0675dd260efac2ac4d25be22f338b935ad83f075b2f4db16215af1b182705cee
3
+ size 4998592741
model-00021-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:058a3e9a3e07640d9560f2cc0db9a57c55fdedb9123004ca854a1be6297472ff
3
+ size 5089847685
model-00022-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fac0af4436150e38511a6ac5bcdcb2b277be4f363d6ce8480094ed1ab9bbbc9f
3
+ size 5089847645
model-00023-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:630fff793e0c1e764754b7babf822567bb81a6d31ea9b1bb5ac89401b9f8fcae
3
+ size 4696602847
model-00024-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fde74d71a8ee6dce17c5acbe7e30cb8569e081a81addd6c6fe6a6d5ec9c46960
3
+ size 4168140014
model-00025-of-00025.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3373ae691adfaeda4846d94592338e8b7cdcc9c3f2e06d7db49707005fca8a73
3
+ size 1229193343
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
modeling_minimax_m2.py ADDED
@@ -0,0 +1,706 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
2
+ # This file was automatically generated from src/transformers/models/minimax_m2/modular_minimax_m2.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_minimax_m2.py file directly. One of our CI enforces this.
6
+ # 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
7
+ # coding=utf-8
8
+ # Copyright 2025 the HuggingFace Team. All rights reserved.
9
+ #
10
+ # Licensed under the Apache License, Version 2.0 (the "License");
11
+ # you may not use this file except in compliance with the License.
12
+ # You may obtain a copy of the License at
13
+ #
14
+ # http://www.apache.org/licenses/LICENSE-2.0
15
+ #
16
+ # Unless required by applicable law or agreed to in writing, software
17
+ # distributed under the License is distributed on an "AS IS" BASIS,
18
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ # See the License for the specific language governing permissions and
20
+ # limitations under the License.
21
+
22
+
23
+ from collections.abc import Callable
24
+ from typing import Optional, Union, Unpack
25
+
26
+ import torch
27
+ from torch import nn
28
+
29
+ from transformers.activations import ACT2FN
30
+ from transformers.cache_utils import Cache, DynamicCache
31
+ from transformers.generation import GenerationMixin
32
+ from transformers.integrations import use_kernel_forward_from_hub
33
+ from transformers.masking_utils import create_causal_mask, create_sliding_window_causal_mask
34
+ from transformers.modeling_flash_attention_utils import FlashAttentionKwargs
35
+ from transformers.modeling_layers import (
36
+ GenericForQuestionAnswering,
37
+ GenericForSequenceClassification,
38
+ GenericForTokenClassification,
39
+ GradientCheckpointingLayer,
40
+ )
41
+ from transformers.modeling_outputs import MoeCausalLMOutputWithPast, MoeModelOutputWithPast
42
+ from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_update
43
+ from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
44
+ from transformers.utils import TransformersKwargs, auto_docstring, can_return_tuple
45
+ from transformers.utils.deprecation import deprecate_kwarg
46
+ from transformers.utils.generic import OutputRecorder, check_model_inputs
47
+ from .configuration_minimax_m2 import MiniMaxM2Config
48
+
49
+
50
+ class MiniMaxM2MLP(nn.Module):
51
+ def __init__(self, config: MiniMaxM2Config):
52
+ super().__init__()
53
+ self.ffn_dim = config.intermediate_size
54
+ self.hidden_dim = config.hidden_size
55
+
56
+ self.w1 = nn.Linear(self.hidden_dim, self.ffn_dim, bias=False)
57
+ self.w2 = nn.Linear(self.ffn_dim, self.hidden_dim, bias=False)
58
+ self.w3 = nn.Linear(self.hidden_dim, self.ffn_dim, bias=False)
59
+
60
+ self.act_fn = ACT2FN[config.hidden_act]
61
+
62
+ def forward(self, hidden_states):
63
+ current_hidden_states = self.act_fn(self.w1(hidden_states)) * self.w3(hidden_states)
64
+ current_hidden_states = self.w2(current_hidden_states)
65
+ return current_hidden_states
66
+
67
+
68
+ class MiniMaxM2Experts(nn.ModuleList):
69
+ """
70
+ ModuleList of experts.
71
+ """
72
+
73
+ def __init__(self, config: MiniMaxM2Config):
74
+ super().__init__()
75
+ self.top_k = config.num_experts_per_tok
76
+ self.num_experts = config.num_local_experts
77
+ for _ in range(self.num_experts):
78
+ self.append(MiniMaxM2MLP(config))
79
+
80
+ def forward(
81
+ self, hidden_states: torch.Tensor, top_k_index: torch.Tensor, top_k_weights: torch.Tensor
82
+ ) -> torch.Tensor:
83
+ """
84
+ Args:
85
+ hidden_states: (batch_size * sequence_length, hidden_dim)
86
+ selected_experts: (batch_size * sequence_length, top_k)
87
+ routing_weights: (batch_size * sequence_length, top_k)
88
+ Returns:
89
+ (batch_size * sequence_length, hidden_dim)
90
+ """
91
+ final_hidden_states = torch.zeros_like(hidden_states)
92
+ expert_mask = torch.nn.functional.one_hot(top_k_index, num_classes=self.num_experts).permute(2, 1, 0)
93
+
94
+ expert_hit = torch.greater(expert_mask.sum(dim=(-1, -2)), 0).nonzero()
95
+ for expert_idx in expert_hit:
96
+ idx, top_x = torch.where(expert_mask[expert_idx].squeeze(0))
97
+ current_state = hidden_states[None, top_x].reshape(-1, hidden_states.shape[-1])
98
+ current_hidden_states = self[expert_idx](current_state) * top_k_weights[top_x, idx, None]
99
+ final_hidden_states.index_add_(0, top_x, current_hidden_states.to(hidden_states.dtype))
100
+ return final_hidden_states
101
+
102
+
103
+ class MiniMaxM2SparseMoeBlock(nn.Module):
104
+ def __init__(self, config):
105
+ super().__init__()
106
+ self.top_k = config.num_experts_per_tok
107
+ self.jitter_noise = config.router_jitter_noise
108
+ self.gate = nn.Linear(config.hidden_size, config.num_local_experts, bias=False)
109
+ self.experts = MiniMaxM2Experts(config)
110
+ self.register_buffer("e_score_correction_bias", torch.zeros(config.num_local_experts))
111
+
112
+ def route_tokens_to_experts(self, router_logits):
113
+ routing_weights = torch.nn.functional.sigmoid(router_logits.float())
114
+ scores_for_choice = routing_weights + self.e_score_correction_bias
115
+ _, top_k_index = torch.topk(scores_for_choice, self.top_k, dim=-1, sorted=False)
116
+ top_k_weights = routing_weights.gather(1, top_k_index)
117
+ top_k_weights /= top_k_weights.sum(dim=-1, keepdim=True)
118
+ return top_k_index, top_k_weights.to(router_logits.dtype)
119
+
120
+ def forward(self, hidden_states: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]:
121
+ batch_size, sequence_length, hidden_dim = hidden_states.shape
122
+ if self.training and self.jitter_noise > 0:
123
+ hidden_states *= torch.empty_like(hidden_states).uniform_(1.0 - self.jitter_noise, 1.0 + self.jitter_noise)
124
+ hidden_states = hidden_states.view(-1, hidden_states.shape[-1])
125
+ router_logits = self.gate(hidden_states)
126
+ top_k_index, top_k_weights = self.route_tokens_to_experts(router_logits)
127
+ hidden_states = self.experts(hidden_states, top_k_index, top_k_weights.to(hidden_states.dtype))
128
+ hidden_states = hidden_states.reshape(batch_size, sequence_length, hidden_dim)
129
+ return hidden_states, router_logits
130
+
131
+
132
+ @use_kernel_forward_from_hub("RMSNorm")
133
+ class MiniMaxM2RMSNorm(nn.Module):
134
+ def __init__(self, hidden_size, eps=1e-6):
135
+ """
136
+ MiniMaxM2RMSNorm is equivalent to T5LayerNorm
137
+ """
138
+ super().__init__()
139
+ self.weight = nn.Parameter(torch.ones(hidden_size))
140
+ self.variance_epsilon = eps
141
+
142
+ def forward(self, hidden_states):
143
+ input_dtype = hidden_states.dtype
144
+ hidden_states = hidden_states.to(torch.float32)
145
+ variance = hidden_states.pow(2).mean(-1, keepdim=True)
146
+ hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
147
+ return self.weight * hidden_states.to(input_dtype)
148
+
149
+ def extra_repr(self):
150
+ return f"{tuple(self.weight.shape)}, eps={self.variance_epsilon}"
151
+
152
+
153
+ def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
154
+ """
155
+ This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
156
+ num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
157
+ """
158
+ batch, num_key_value_heads, slen, head_dim = hidden_states.shape
159
+ if n_rep == 1:
160
+ return hidden_states
161
+ hidden_states = hidden_states[:, :, None, :, :].expand(batch, num_key_value_heads, n_rep, slen, head_dim)
162
+ return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
163
+
164
+
165
+ def eager_attention_forward(
166
+ module: nn.Module,
167
+ query: torch.Tensor,
168
+ key: torch.Tensor,
169
+ value: torch.Tensor,
170
+ attention_mask: Optional[torch.Tensor],
171
+ scaling: float,
172
+ dropout: float = 0.0,
173
+ **kwargs: Unpack[TransformersKwargs],
174
+ ):
175
+ key_states = repeat_kv(key, module.num_key_value_groups)
176
+ value_states = repeat_kv(value, module.num_key_value_groups)
177
+
178
+ attn_weights = torch.matmul(query, key_states.transpose(2, 3)) * scaling
179
+ if attention_mask is not None:
180
+ causal_mask = attention_mask[:, :, :, : key_states.shape[-2]]
181
+ attn_weights = attn_weights + causal_mask
182
+
183
+ attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(query.dtype)
184
+ attn_weights = nn.functional.dropout(attn_weights, p=dropout, training=module.training)
185
+ attn_output = torch.matmul(attn_weights, value_states)
186
+ attn_output = attn_output.transpose(1, 2).contiguous()
187
+
188
+ return attn_output, attn_weights
189
+
190
+
191
+ def rotate_half(x):
192
+ """Rotates half the hidden dims of the input."""
193
+ x1 = x[..., : x.shape[-1] // 2]
194
+ x2 = x[..., x.shape[-1] // 2 :]
195
+ return torch.cat((-x2, x1), dim=-1)
196
+
197
+
198
+ def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_dim=1):
199
+ """Applies Rotary Position Embedding to the query and key tensors.
200
+
201
+ Args:
202
+ q (`torch.Tensor`): The query tensor.
203
+ k (`torch.Tensor`): The key tensor.
204
+ cos (`torch.Tensor`): The cosine part of the rotary embedding.
205
+ sin (`torch.Tensor`): The sine part of the rotary embedding.
206
+ position_ids (`torch.Tensor`, *optional*):
207
+ Deprecated and unused.
208
+ unsqueeze_dim (`int`, *optional*, defaults to 1):
209
+ The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
210
+ sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
211
+ that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
212
+ k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
213
+ cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
214
+ the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
215
+ Returns:
216
+ `tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
217
+ """
218
+ cos = cos.unsqueeze(unsqueeze_dim)
219
+ sin = sin.unsqueeze(unsqueeze_dim)
220
+
221
+ # Keep half or full tensor for later concatenation
222
+ rotary_dim = cos.shape[-1]
223
+ q_rot, q_pass = q[..., :rotary_dim], q[..., rotary_dim:]
224
+ k_rot, k_pass = k[..., :rotary_dim], k[..., rotary_dim:]
225
+
226
+ # Apply rotary embeddings on the first half or full tensor
227
+ q_embed = (q_rot * cos) + (rotate_half(q_rot) * sin)
228
+ k_embed = (k_rot * cos) + (rotate_half(k_rot) * sin)
229
+
230
+ # Concatenate back to full shape
231
+ q_embed = torch.cat([q_embed, q_pass], dim=-1)
232
+ k_embed = torch.cat([k_embed, k_pass], dim=-1)
233
+ return q_embed, k_embed
234
+
235
+
236
+ class MiniMaxM2Attention(nn.Module):
237
+ """Multi-headed attention from 'Attention Is All You Need' paper"""
238
+
239
+ def __init__(self, config: MiniMaxM2Config, layer_idx: int):
240
+ super().__init__()
241
+ self.config = config
242
+ self.layer_idx = layer_idx
243
+ self.head_dim = getattr(config, "head_dim", None) or config.hidden_size // config.num_attention_heads
244
+ self.num_key_value_groups = config.num_attention_heads // config.num_key_value_heads
245
+ self.scaling = self.head_dim**-0.5
246
+ self.attention_dropout = config.attention_dropout
247
+ self.is_causal = True
248
+ self.q_proj = nn.Linear(config.hidden_size, config.num_attention_heads * self.head_dim, bias=False)
249
+ self.k_proj = nn.Linear(config.hidden_size, config.num_key_value_heads * self.head_dim, bias=False)
250
+ self.v_proj = nn.Linear(config.hidden_size, config.num_key_value_heads * self.head_dim, bias=False)
251
+ self.o_proj = nn.Linear(config.num_attention_heads * self.head_dim, config.hidden_size, bias=False)
252
+
253
+ self.use_qk_norm = config.use_qk_norm
254
+ if self.use_qk_norm:
255
+ self.q_norm = MiniMaxM2RMSNorm(self.head_dim * config.num_attention_heads, eps=config.rms_norm_eps)
256
+ self.k_norm = MiniMaxM2RMSNorm(self.head_dim * config.num_key_value_heads, eps=config.rms_norm_eps)
257
+
258
+ @deprecate_kwarg("past_key_value", new_name="past_key_values", version="4.58")
259
+ def forward(
260
+ self,
261
+ hidden_states: torch.Tensor,
262
+ position_embeddings: tuple[torch.Tensor, torch.Tensor],
263
+ attention_mask: Optional[torch.Tensor],
264
+ past_key_values: Optional[Cache] = None,
265
+ cache_position: Optional[torch.LongTensor] = None,
266
+ **kwargs: Unpack[FlashAttentionKwargs],
267
+ ) -> tuple[torch.Tensor, Optional[torch.Tensor]]:
268
+ input_shape = hidden_states.shape[:-1]
269
+ hidden_shape = (*input_shape, -1, self.head_dim)
270
+
271
+ query_states = self.q_proj(hidden_states)
272
+ key_states = self.k_proj(hidden_states)
273
+ value_states = self.v_proj(hidden_states)
274
+
275
+ if self.use_qk_norm: # main diff from Llama
276
+ query_states = self.q_norm(query_states)
277
+ key_states = self.k_norm(key_states)
278
+
279
+ key_states = key_states.view(hidden_shape)
280
+ query_states = query_states.view(hidden_shape)
281
+ value_states = value_states.view(hidden_shape)
282
+
283
+ query_states = query_states.transpose(1, 2)
284
+ key_states = key_states.transpose(1, 2)
285
+ value_states = value_states.transpose(1, 2)
286
+
287
+ cos, sin = position_embeddings
288
+ query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
289
+
290
+ if past_key_values is not None:
291
+ # sin and cos are specific to RoPE models; position_ids needed for the static cache
292
+ cache_kwargs = {"sin": sin, "cos": cos, "cache_position": cache_position}
293
+ key_states, value_states = past_key_values.update(key_states, value_states, self.layer_idx, cache_kwargs)
294
+
295
+ attention_interface: Callable = eager_attention_forward
296
+ if self.config._attn_implementation != "eager":
297
+ attention_interface = ALL_ATTENTION_FUNCTIONS[self.config._attn_implementation]
298
+
299
+ attn_output, attn_weights = attention_interface(
300
+ self,
301
+ query_states,
302
+ key_states,
303
+ value_states,
304
+ attention_mask,
305
+ dropout=0.0 if not self.training else self.attention_dropout,
306
+ scaling=self.scaling,
307
+ **kwargs,
308
+ )
309
+
310
+ attn_output = attn_output.reshape(*input_shape, -1).contiguous()
311
+ attn_output = self.o_proj(attn_output)
312
+ return attn_output, attn_weights
313
+
314
+
315
+ class MiniMaxM2DecoderLayer(GradientCheckpointingLayer):
316
+ def __init__(self, config: MiniMaxM2Config, layer_idx: int):
317
+ super().__init__()
318
+ self.hidden_size = config.hidden_size
319
+
320
+ self.self_attn = MiniMaxM2Attention(config, layer_idx)
321
+
322
+ self.block_sparse_moe = MiniMaxM2SparseMoeBlock(config)
323
+ self.input_layernorm = MiniMaxM2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
324
+ self.post_attention_layernorm = MiniMaxM2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
325
+
326
+ @deprecate_kwarg("past_key_value", new_name="past_key_values", version="4.58")
327
+ def forward(
328
+ self,
329
+ hidden_states: torch.Tensor,
330
+ position_embeddings: tuple[torch.Tensor, torch.Tensor],
331
+ attention_mask: Optional[torch.Tensor] = None,
332
+ position_ids: Optional[torch.LongTensor] = None,
333
+ past_key_values: Optional[Cache] = None,
334
+ cache_position: Optional[torch.LongTensor] = None,
335
+ **kwargs: Unpack[TransformersKwargs],
336
+ ) -> torch.FloatTensor:
337
+ residual = hidden_states
338
+
339
+ hidden_states = self.input_layernorm(hidden_states)
340
+
341
+ # Self Attention
342
+ hidden_states, _ = self.self_attn(
343
+ hidden_states=hidden_states,
344
+ position_embeddings=position_embeddings,
345
+ attention_mask=attention_mask,
346
+ position_ids=position_ids,
347
+ past_key_values=past_key_values,
348
+ cache_position=cache_position,
349
+ **kwargs,
350
+ )
351
+ hidden_states = residual + hidden_states
352
+
353
+ # Fully Connected
354
+ residual = hidden_states
355
+ hidden_states = self.post_attention_layernorm(hidden_states)
356
+ hidden_states, _ = self.block_sparse_moe(hidden_states)
357
+ hidden_states = residual + hidden_states
358
+
359
+ return hidden_states
360
+
361
+
362
+ class MiniMaxM2RotaryEmbedding(nn.Module):
363
+ inv_freq: torch.Tensor # fix linting for `register_buffer`
364
+
365
+ def __init__(self, config: MiniMaxM2Config, device=None):
366
+ super().__init__()
367
+ # BC: "rope_type" was originally "type"
368
+ if hasattr(config, "rope_scaling") and isinstance(config.rope_scaling, dict):
369
+ self.rope_type = config.rope_scaling.get("rope_type", config.rope_scaling.get("type"))
370
+ else:
371
+ self.rope_type = "default"
372
+ self.max_seq_len_cached = config.max_position_embeddings
373
+ self.original_max_seq_len = config.max_position_embeddings
374
+
375
+ self.config = config
376
+ self.rope_init_fn = ROPE_INIT_FUNCTIONS[self.rope_type]
377
+
378
+ inv_freq, self.attention_scaling = self.rope_init_fn(self.config, device)
379
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
380
+ self.original_inv_freq = self.inv_freq
381
+
382
+ @torch.no_grad()
383
+ @dynamic_rope_update # power user: used with advanced RoPE types (e.g. dynamic rope)
384
+ def forward(self, x, position_ids):
385
+ inv_freq_expanded = self.inv_freq[None, :, None].float().expand(position_ids.shape[0], -1, 1).to(x.device)
386
+ position_ids_expanded = position_ids[:, None, :].float()
387
+
388
+ device_type = x.device.type if isinstance(x.device.type, str) and x.device.type != "mps" else "cpu"
389
+ with torch.autocast(device_type=device_type, enabled=False): # Force float32
390
+ freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
391
+ emb = torch.cat((freqs, freqs), dim=-1)
392
+ cos = emb.cos() * self.attention_scaling
393
+ sin = emb.sin() * self.attention_scaling
394
+
395
+ return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
396
+
397
+
398
+ @auto_docstring
399
+ class MiniMaxM2PreTrainedModel(PreTrainedModel):
400
+ config: MiniMaxM2Config
401
+ base_model_prefix = "model"
402
+ supports_gradient_checkpointing = True
403
+ _no_split_modules = ["MiniMaxM2DecoderLayer"]
404
+ _skip_keys_device_placement = ["past_key_values"]
405
+ _supports_flash_attn = True
406
+ _supports_sdpa = True
407
+ _supports_flex_attn = True
408
+ _can_compile_fullgraph = False # MoE models don't work with torch.compile (`torch.where(condition)` not supported)
409
+ _supports_attention_backend = True
410
+ _can_record_outputs = {
411
+ "router_logits": OutputRecorder(MiniMaxM2SparseMoeBlock, index=1),
412
+ "hidden_states": MiniMaxM2DecoderLayer,
413
+ "attentions": MiniMaxM2Attention,
414
+ }
415
+
416
+
417
+ @auto_docstring
418
+ class MiniMaxM2Model(MiniMaxM2PreTrainedModel):
419
+ def __init__(self, config: MiniMaxM2Config):
420
+ super().__init__(config)
421
+ self.padding_idx = config.pad_token_id
422
+ self.vocab_size = config.vocab_size
423
+
424
+ self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.padding_idx)
425
+ self.layers = nn.ModuleList(
426
+ [MiniMaxM2DecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
427
+ )
428
+ self.norm = MiniMaxM2RMSNorm(config.hidden_size, eps=config.rms_norm_eps)
429
+ self.rotary_emb = MiniMaxM2RotaryEmbedding(config=config)
430
+ self.gradient_checkpointing = False
431
+
432
+ # Initialize weights and apply final processing
433
+ self.post_init()
434
+
435
+ @check_model_inputs
436
+ @auto_docstring
437
+ def forward(
438
+ self,
439
+ input_ids: Optional[torch.LongTensor] = None,
440
+ attention_mask: Optional[torch.Tensor] = None,
441
+ position_ids: Optional[torch.LongTensor] = None,
442
+ past_key_values: Optional[Cache] = None,
443
+ inputs_embeds: Optional[torch.FloatTensor] = None,
444
+ use_cache: Optional[bool] = None,
445
+ cache_position: Optional[torch.LongTensor] = None,
446
+ **kwargs: Unpack[TransformersKwargs],
447
+ ) -> MoeModelOutputWithPast:
448
+ if (input_ids is None) ^ (inputs_embeds is not None):
449
+ raise ValueError("You must specify exactly one of input_ids or inputs_embeds")
450
+
451
+ if use_cache and past_key_values is None:
452
+ past_key_values = DynamicCache(config=self.config)
453
+
454
+ if inputs_embeds is None:
455
+ inputs_embeds = self.embed_tokens(input_ids)
456
+
457
+ if cache_position is None:
458
+ past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0
459
+ cache_position = torch.arange(
460
+ past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
461
+ )
462
+ if position_ids is None:
463
+ position_ids = cache_position.unsqueeze(0)
464
+
465
+ mask_function = create_causal_mask if self.config.sliding_window is None else create_sliding_window_causal_mask
466
+ causal_mask = mask_function(
467
+ config=self.config,
468
+ input_embeds=inputs_embeds,
469
+ attention_mask=attention_mask,
470
+ cache_position=cache_position,
471
+ past_key_values=past_key_values,
472
+ position_ids=position_ids,
473
+ )
474
+
475
+ hidden_states = inputs_embeds
476
+
477
+ # create position embeddings to be shared across the decoder layers
478
+ position_embeddings = self.rotary_emb(hidden_states, position_ids)
479
+
480
+ for decoder_layer in self.layers[: self.config.num_hidden_layers]:
481
+ hidden_states = decoder_layer(
482
+ hidden_states,
483
+ position_embeddings=position_embeddings,
484
+ attention_mask=causal_mask,
485
+ position_ids=position_ids,
486
+ past_key_values=past_key_values,
487
+ use_cache=use_cache,
488
+ cache_position=cache_position,
489
+ **kwargs,
490
+ )
491
+
492
+ hidden_states = self.norm(hidden_states)
493
+
494
+ return MoeModelOutputWithPast( # only diff with Mistral is the output type, we need MoE
495
+ last_hidden_state=hidden_states,
496
+ past_key_values=past_key_values,
497
+ )
498
+
499
+
500
+ def load_balancing_loss_func(
501
+ gate_logits: Union[torch.Tensor, tuple[torch.Tensor], None],
502
+ num_experts: Optional[int] = None,
503
+ top_k=2,
504
+ attention_mask: Optional[torch.Tensor] = None,
505
+ ) -> Union[torch.Tensor, int]:
506
+ r"""
507
+ Computes auxiliary load balancing loss as in Switch Transformer - implemented in Pytorch.
508
+
509
+ See Switch Transformer (https://huggingface.co/papers/2101.03961) for more details. This function implements the loss
510
+ function presented in equations (4) - (6) of the paper. It aims at penalizing cases where the routing between
511
+ experts is too unbalanced.
512
+
513
+ Args:
514
+ gate_logits:
515
+ Logits from the `gate`, should be a tuple of model.config.num_hidden_layers tensors of
516
+ shape [batch_size X sequence_length, num_experts].
517
+ num_experts:
518
+ Number of experts
519
+ top_k:
520
+ The number of experts to route per-token, can be also interpreted as the `top-k` routing
521
+ parameter.
522
+ attention_mask (`torch.Tensor`, *optional*):
523
+ The attention_mask used in forward function
524
+ shape [batch_size X sequence_length] if not None.
525
+
526
+ Returns:
527
+ The auxiliary loss.
528
+ """
529
+ if gate_logits is None or not isinstance(gate_logits, tuple):
530
+ return 0
531
+
532
+ if isinstance(gate_logits, tuple):
533
+ compute_device = gate_logits[0].device
534
+ concatenated_gate_logits = torch.cat([layer_gate.to(compute_device) for layer_gate in gate_logits], dim=0)
535
+
536
+ routing_weights = torch.nn.functional.softmax(concatenated_gate_logits, dim=-1)
537
+
538
+ _, selected_experts = torch.topk(routing_weights, top_k, dim=-1)
539
+
540
+ expert_mask = torch.nn.functional.one_hot(selected_experts, num_experts)
541
+
542
+ if attention_mask is None:
543
+ # Compute the percentage of tokens routed to each experts
544
+ tokens_per_expert = torch.mean(expert_mask.float(), dim=0)
545
+
546
+ # Compute the average probability of routing to these experts
547
+ router_prob_per_expert = torch.mean(routing_weights, dim=0)
548
+ else:
549
+ batch_size, sequence_length = attention_mask.shape
550
+ num_hidden_layers = concatenated_gate_logits.shape[0] // (batch_size * sequence_length)
551
+
552
+ # Compute the mask that masks all padding tokens as 0 with the same shape of expert_mask
553
+ expert_attention_mask = (
554
+ attention_mask[None, :, :, None, None]
555
+ .expand((num_hidden_layers, batch_size, sequence_length, top_k, num_experts))
556
+ .reshape(-1, top_k, num_experts)
557
+ .to(compute_device)
558
+ )
559
+
560
+ # Compute the percentage of tokens routed to each experts
561
+ tokens_per_expert = torch.sum(expert_mask.float() * expert_attention_mask, dim=0) / torch.sum(
562
+ expert_attention_mask, dim=0
563
+ )
564
+
565
+ # Compute the mask that masks all padding tokens as 0 with the same shape of tokens_per_expert
566
+ router_per_expert_attention_mask = (
567
+ attention_mask[None, :, :, None]
568
+ .expand((num_hidden_layers, batch_size, sequence_length, num_experts))
569
+ .reshape(-1, num_experts)
570
+ .to(compute_device)
571
+ )
572
+
573
+ # Compute the average probability of routing to these experts
574
+ router_prob_per_expert = torch.sum(routing_weights * router_per_expert_attention_mask, dim=0) / torch.sum(
575
+ router_per_expert_attention_mask, dim=0
576
+ )
577
+
578
+ overall_loss = torch.sum(tokens_per_expert * router_prob_per_expert.unsqueeze(0))
579
+ return overall_loss * num_experts
580
+
581
+
582
+ @auto_docstring
583
+ class MiniMaxM2ForCausalLM(MiniMaxM2PreTrainedModel, GenerationMixin):
584
+ _tied_weights_keys = ["lm_head.weight"]
585
+ _tp_plan = {"lm_head": "colwise_rep"}
586
+ _pp_plan = {"lm_head": (["hidden_states"], ["logits"])}
587
+
588
+ def __init__(self, config):
589
+ super().__init__(config)
590
+ self.model = MiniMaxM2Model(config)
591
+ self.vocab_size = config.vocab_size
592
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
593
+ self.router_aux_loss_coef = config.router_aux_loss_coef
594
+ self.num_experts = config.num_local_experts
595
+ self.num_experts_per_tok = config.num_experts_per_tok
596
+
597
+ # Initialize weights and apply final processing
598
+ self.post_init()
599
+
600
+ @can_return_tuple
601
+ @auto_docstring
602
+ def forward(
603
+ self,
604
+ input_ids: Optional[torch.LongTensor] = None,
605
+ attention_mask: Optional[torch.Tensor] = None,
606
+ position_ids: Optional[torch.LongTensor] = None,
607
+ past_key_values: Optional[Cache] = None,
608
+ inputs_embeds: Optional[torch.FloatTensor] = None,
609
+ labels: Optional[torch.LongTensor] = None,
610
+ use_cache: Optional[bool] = None,
611
+ output_router_logits: Optional[bool] = None,
612
+ cache_position: Optional[torch.LongTensor] = None,
613
+ logits_to_keep: Union[int, torch.Tensor] = 0,
614
+ **kwargs: Unpack[TransformersKwargs],
615
+ ) -> MoeCausalLMOutputWithPast:
616
+ r"""
617
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
618
+ Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
619
+ config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
620
+ (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
621
+
622
+ Example:
623
+
624
+ ```python
625
+ >>> from transformers import AutoTokenizer, MiniMaxM2ForCausalLM
626
+
627
+ >>> model = MiniMaxM2ForCausalLM.from_pretrained("mistralai/MiniMaxM2-8x7B-v0.1")
628
+ >>> tokenizer = AutoTokenizer.from_pretrained("mistralai/MiniMaxM2-8x7B-v0.1")
629
+
630
+ >>> prompt = "Hey, are you conscious? Can you talk to me?"
631
+ >>> inputs = tokenizer(prompt, return_tensors="pt")
632
+
633
+ >>> # Generate
634
+ >>> generate_ids = model.generate(inputs.input_ids, max_length=30)
635
+ >>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
636
+ "Hey, are you conscious? Can you talk to me?\nI'm not conscious, but I can talk to you."
637
+ ```"""
638
+
639
+ output_router_logits = (
640
+ output_router_logits if output_router_logits is not None else self.config.output_router_logits
641
+ )
642
+
643
+ # decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
644
+ outputs: MoeModelOutputWithPast = self.model(
645
+ input_ids=input_ids,
646
+ attention_mask=attention_mask,
647
+ position_ids=position_ids,
648
+ past_key_values=past_key_values,
649
+ inputs_embeds=inputs_embeds,
650
+ use_cache=use_cache,
651
+ output_router_logits=output_router_logits,
652
+ cache_position=cache_position,
653
+ **kwargs,
654
+ )
655
+
656
+ hidden_states = outputs.last_hidden_state
657
+ # Only compute necessary logits, and do not upcast them to float if we are not computing the loss
658
+ slice_indices = slice(-logits_to_keep, None) if isinstance(logits_to_keep, int) else logits_to_keep
659
+ logits = self.lm_head(hidden_states[:, slice_indices, :])
660
+
661
+ loss = None
662
+ if labels is not None:
663
+ loss = self.loss_function(logits, labels, self.vocab_size, **kwargs)
664
+
665
+ aux_loss = None
666
+ if output_router_logits:
667
+ aux_loss = load_balancing_loss_func(
668
+ outputs.router_logits,
669
+ self.num_experts,
670
+ self.num_experts_per_tok,
671
+ attention_mask,
672
+ )
673
+ if labels is not None:
674
+ loss += self.router_aux_loss_coef * aux_loss.to(loss.device) # make sure to reside in the same device
675
+
676
+ return MoeCausalLMOutputWithPast(
677
+ loss=loss,
678
+ aux_loss=aux_loss,
679
+ logits=logits,
680
+ past_key_values=outputs.past_key_values,
681
+ hidden_states=outputs.hidden_states,
682
+ attentions=outputs.attentions,
683
+ router_logits=outputs.router_logits,
684
+ )
685
+
686
+
687
+ class MiniMaxM2ForSequenceClassification(GenericForSequenceClassification, MiniMaxM2PreTrainedModel):
688
+ pass
689
+
690
+
691
+ class MiniMaxM2ForTokenClassification(GenericForTokenClassification, MiniMaxM2PreTrainedModel):
692
+ pass
693
+
694
+
695
+ class MiniMaxM2ForQuestionAnswering(GenericForQuestionAnswering, MiniMaxM2PreTrainedModel):
696
+ pass
697
+
698
+
699
+ __all__ = [
700
+ "MiniMaxM2ForCausalLM",
701
+ "MiniMaxM2ForQuestionAnswering",
702
+ "MiniMaxM2Model",
703
+ "MiniMaxM2PreTrainedModel",
704
+ "MiniMaxM2ForSequenceClassification",
705
+ "MiniMaxM2ForTokenClassification",
706
+ ]
special_tokens_map.json ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<code_interpreter>",
4
+ "<commit_after>",
5
+ "<commit_before>",
6
+ "<commit_msg>",
7
+ "<empty_output>",
8
+ "<filename>",
9
+ "<fim_middle>",
10
+ "<fim_pad>",
11
+ "<fim_prefix>",
12
+ "<fim_suffix>",
13
+ "<function_call>",
14
+ "<gh_stars>",
15
+ "]<]speech[>[",
16
+ "]<]image[>[",
17
+ "]<]video[>[",
18
+ "]<]start of speech[>[",
19
+ "]<]end of speech[>[",
20
+ "]<]start of image[>[",
21
+ "]<]end of image[>[",
22
+ "]<]start of video[>[",
23
+ "]<]end of video[>[",
24
+ "]<]vision pad[>[",
25
+ "]~!b[",
26
+ "<issue_closed>",
27
+ "<issue_comment>",
28
+ "<issue_start>",
29
+ "<jupyter_code>",
30
+ "<jupyter_output>",
31
+ "<jupyter_start>",
32
+ "<jupyter_text>",
33
+ "<reponame>",
34
+ "[e~[",
35
+ "]!d~[",
36
+ "]!p~[",
37
+ "]~b]",
38
+ "<jupyter_error>",
39
+ "<add_file>",
40
+ "<delete_file>",
41
+ "<rename_file>",
42
+ "<edit_file>",
43
+ "<commit_message>",
44
+ "<empty_source_file>",
45
+ "<repo_struct>",
46
+ "<code_context>",
47
+ "<file_content>",
48
+ "<source_files>",
49
+ "<pr_start>",
50
+ "<review_comment>",
51
+ "<filepath>",
52
+ "<file_sep>"
53
+ ],
54
+ "bos_token": {
55
+ "content": "]~!b[",
56
+ "lstrip": false,
57
+ "normalized": false,
58
+ "rstrip": false,
59
+ "single_word": false
60
+ },
61
+ "eos_token": {
62
+ "content": "[e~[",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false
67
+ },
68
+ "unk_token": {
69
+ "content": "]!d~[",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false
74
+ }
75
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e7b90ed7f55d905175bc26771d6d7d33b40b46742f073675bc816fedaf482ea1
3
+ size 15522763
tokenizer_config.json ADDED
@@ -0,0 +1,497 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "200000": {
5
+ "content": "]!p~[",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "200001": {
13
+ "content": "<fim_prefix>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "200002": {
21
+ "content": "<fim_middle>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "200003": {
29
+ "content": "<fim_suffix>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "200004": {
37
+ "content": "<fim_pad>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "200005": {
45
+ "content": "<reponame>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "200006": {
53
+ "content": "<filename>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "200007": {
61
+ "content": "<gh_stars>",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "200008": {
69
+ "content": "<issue_start>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "200009": {
77
+ "content": "<issue_comment>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "200010": {
85
+ "content": "<issue_closed>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "200011": {
93
+ "content": "<jupyter_start>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ },
100
+ "200012": {
101
+ "content": "<jupyter_text>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": true
107
+ },
108
+ "200013": {
109
+ "content": "<jupyter_code>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": true
115
+ },
116
+ "200014": {
117
+ "content": "<jupyter_output>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": true
123
+ },
124
+ "200015": {
125
+ "content": "<empty_output>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": true
131
+ },
132
+ "200016": {
133
+ "content": "<commit_before>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": true
139
+ },
140
+ "200017": {
141
+ "content": "<commit_msg>",
142
+ "lstrip": false,
143
+ "normalized": false,
144
+ "rstrip": false,
145
+ "single_word": false,
146
+ "special": true
147
+ },
148
+ "200018": {
149
+ "content": "<commit_after>",
150
+ "lstrip": false,
151
+ "normalized": false,
152
+ "rstrip": false,
153
+ "single_word": false,
154
+ "special": true
155
+ },
156
+ "200019": {
157
+ "content": "]~b]",
158
+ "lstrip": false,
159
+ "normalized": false,
160
+ "rstrip": false,
161
+ "single_word": false,
162
+ "special": true
163
+ },
164
+ "200020": {
165
+ "content": "[e~[",
166
+ "lstrip": false,
167
+ "normalized": false,
168
+ "rstrip": false,
169
+ "single_word": false,
170
+ "special": true
171
+ },
172
+ "200021": {
173
+ "content": "]!d~[",
174
+ "lstrip": false,
175
+ "normalized": false,
176
+ "rstrip": false,
177
+ "single_word": false,
178
+ "special": true
179
+ },
180
+ "200022": {
181
+ "content": "<function_call>",
182
+ "lstrip": false,
183
+ "normalized": false,
184
+ "rstrip": false,
185
+ "single_word": false,
186
+ "special": true
187
+ },
188
+ "200023": {
189
+ "content": "<code_interpreter>",
190
+ "lstrip": false,
191
+ "normalized": false,
192
+ "rstrip": false,
193
+ "single_word": false,
194
+ "special": true
195
+ },
196
+ "200024": {
197
+ "content": "]<]speech[>[",
198
+ "lstrip": false,
199
+ "normalized": false,
200
+ "rstrip": false,
201
+ "single_word": false,
202
+ "special": true
203
+ },
204
+ "200025": {
205
+ "content": "]<]image[>[",
206
+ "lstrip": false,
207
+ "normalized": false,
208
+ "rstrip": false,
209
+ "single_word": false,
210
+ "special": true
211
+ },
212
+ "200026": {
213
+ "content": "]<]video[>[",
214
+ "lstrip": false,
215
+ "normalized": false,
216
+ "rstrip": false,
217
+ "single_word": false,
218
+ "special": true
219
+ },
220
+ "200027": {
221
+ "content": "]<]start of speech[>[",
222
+ "lstrip": false,
223
+ "normalized": false,
224
+ "rstrip": false,
225
+ "single_word": false,
226
+ "special": true
227
+ },
228
+ "200028": {
229
+ "content": "]<]end of speech[>[",
230
+ "lstrip": false,
231
+ "normalized": false,
232
+ "rstrip": false,
233
+ "single_word": false,
234
+ "special": true
235
+ },
236
+ "200029": {
237
+ "content": "]<]start of image[>[",
238
+ "lstrip": false,
239
+ "normalized": false,
240
+ "rstrip": false,
241
+ "single_word": false,
242
+ "special": true
243
+ },
244
+ "200030": {
245
+ "content": "]<]end of image[>[",
246
+ "lstrip": false,
247
+ "normalized": false,
248
+ "rstrip": false,
249
+ "single_word": false,
250
+ "special": true
251
+ },
252
+ "200031": {
253
+ "content": "]<]start of video[>[",
254
+ "lstrip": false,
255
+ "normalized": false,
256
+ "rstrip": false,
257
+ "single_word": false,
258
+ "special": true
259
+ },
260
+ "200032": {
261
+ "content": "]<]end of video[>[",
262
+ "lstrip": false,
263
+ "normalized": false,
264
+ "rstrip": false,
265
+ "single_word": false,
266
+ "special": true
267
+ },
268
+ "200033": {
269
+ "content": "]<]vision pad[>[",
270
+ "lstrip": false,
271
+ "normalized": false,
272
+ "rstrip": false,
273
+ "single_word": false,
274
+ "special": true
275
+ },
276
+ "200034": {
277
+ "content": "]~!b[",
278
+ "lstrip": false,
279
+ "normalized": false,
280
+ "rstrip": false,
281
+ "single_word": false,
282
+ "special": true
283
+ },
284
+ "200035": {
285
+ "content": "<jupyter_error>",
286
+ "lstrip": false,
287
+ "normalized": false,
288
+ "rstrip": false,
289
+ "single_word": false,
290
+ "special": true
291
+ },
292
+ "200036": {
293
+ "content": "<add_file>",
294
+ "lstrip": false,
295
+ "normalized": false,
296
+ "rstrip": false,
297
+ "single_word": false,
298
+ "special": true
299
+ },
300
+ "200037": {
301
+ "content": "<delete_file>",
302
+ "lstrip": false,
303
+ "normalized": false,
304
+ "rstrip": false,
305
+ "single_word": false,
306
+ "special": true
307
+ },
308
+ "200038": {
309
+ "content": "<rename_file>",
310
+ "lstrip": false,
311
+ "normalized": false,
312
+ "rstrip": false,
313
+ "single_word": false,
314
+ "special": true
315
+ },
316
+ "200039": {
317
+ "content": "<edit_file>",
318
+ "lstrip": false,
319
+ "normalized": false,
320
+ "rstrip": false,
321
+ "single_word": false,
322
+ "special": true
323
+ },
324
+ "200040": {
325
+ "content": "<commit_message>",
326
+ "lstrip": false,
327
+ "normalized": false,
328
+ "rstrip": false,
329
+ "single_word": false,
330
+ "special": true
331
+ },
332
+ "200041": {
333
+ "content": "<empty_source_file>",
334
+ "lstrip": false,
335
+ "normalized": false,
336
+ "rstrip": false,
337
+ "single_word": false,
338
+ "special": true
339
+ },
340
+ "200042": {
341
+ "content": "<repo_struct>",
342
+ "lstrip": false,
343
+ "normalized": false,
344
+ "rstrip": false,
345
+ "single_word": false,
346
+ "special": true
347
+ },
348
+ "200043": {
349
+ "content": "<code_context>",
350
+ "lstrip": false,
351
+ "normalized": false,
352
+ "rstrip": false,
353
+ "single_word": false,
354
+ "special": true
355
+ },
356
+ "200044": {
357
+ "content": "<file_content>",
358
+ "lstrip": false,
359
+ "normalized": false,
360
+ "rstrip": false,
361
+ "single_word": false,
362
+ "special": true
363
+ },
364
+ "200045": {
365
+ "content": "<source_files>",
366
+ "lstrip": false,
367
+ "normalized": false,
368
+ "rstrip": false,
369
+ "single_word": false,
370
+ "special": true
371
+ },
372
+ "200046": {
373
+ "content": "<pr_start>",
374
+ "lstrip": false,
375
+ "normalized": false,
376
+ "rstrip": false,
377
+ "single_word": false,
378
+ "special": true
379
+ },
380
+ "200047": {
381
+ "content": "<review_comment>",
382
+ "lstrip": false,
383
+ "normalized": false,
384
+ "rstrip": false,
385
+ "single_word": false,
386
+ "special": true
387
+ },
388
+ "200048": {
389
+ "content": "<filepath>",
390
+ "lstrip": false,
391
+ "normalized": false,
392
+ "rstrip": false,
393
+ "single_word": false,
394
+ "special": true
395
+ },
396
+ "200049": {
397
+ "content": "<file_sep>",
398
+ "lstrip": false,
399
+ "normalized": false,
400
+ "rstrip": false,
401
+ "single_word": false,
402
+ "special": true
403
+ },
404
+ "200050": {
405
+ "content": "<think>",
406
+ "lstrip": false,
407
+ "normalized": false,
408
+ "rstrip": false,
409
+ "single_word": false,
410
+ "special": false
411
+ },
412
+ "200051": {
413
+ "content": "</think>",
414
+ "lstrip": false,
415
+ "normalized": false,
416
+ "rstrip": false,
417
+ "single_word": false,
418
+ "special": false
419
+ },
420
+ "200052": {
421
+ "content": "<minimax:tool_call>",
422
+ "lstrip": false,
423
+ "normalized": false,
424
+ "rstrip": false,
425
+ "single_word": false,
426
+ "special": false
427
+ },
428
+ "200053": {
429
+ "content": "</minimax:tool_call>",
430
+ "lstrip": false,
431
+ "normalized": false,
432
+ "rstrip": false,
433
+ "single_word": false,
434
+ "special": false
435
+ }
436
+ },
437
+ "additional_special_tokens": [
438
+ "<code_interpreter>",
439
+ "<commit_after>",
440
+ "<commit_before>",
441
+ "<commit_msg>",
442
+ "<empty_output>",
443
+ "<filename>",
444
+ "<fim_middle>",
445
+ "<fim_pad>",
446
+ "<fim_prefix>",
447
+ "<fim_suffix>",
448
+ "<function_call>",
449
+ "<gh_stars>",
450
+ "]<]speech[>[",
451
+ "]<]image[>[",
452
+ "]<]video[>[",
453
+ "]<]start of speech[>[",
454
+ "]<]end of speech[>[",
455
+ "]<]start of image[>[",
456
+ "]<]end of image[>[",
457
+ "]<]start of video[>[",
458
+ "]<]end of video[>[",
459
+ "]<]vision pad[>[",
460
+ "]~!b[",
461
+ "<issue_closed>",
462
+ "<issue_comment>",
463
+ "<issue_start>",
464
+ "<jupyter_code>",
465
+ "<jupyter_output>",
466
+ "<jupyter_start>",
467
+ "<jupyter_text>",
468
+ "<reponame>",
469
+ "[e~[",
470
+ "]!d~[",
471
+ "]!p~[",
472
+ "]~b]",
473
+ "<jupyter_error>",
474
+ "<add_file>",
475
+ "<delete_file>",
476
+ "<rename_file>",
477
+ "<edit_file>",
478
+ "<commit_message>",
479
+ "<empty_source_file>",
480
+ "<repo_struct>",
481
+ "<code_context>",
482
+ "<file_content>",
483
+ "<source_files>",
484
+ "<pr_start>",
485
+ "<review_comment>",
486
+ "<filepath>",
487
+ "<file_sep>"
488
+ ],
489
+ "bos_token": "]~!b[",
490
+ "clean_up_tokenization_spaces": false,
491
+ "eos_token": "[e~[",
492
+ "extra_special_tokens": {},
493
+ "model_max_length": 40960000,
494
+ "tokenizer_class": "GPT2Tokenizer",
495
+ "tool_parser_type": "minimax_m2",
496
+ "unk_token": "]!d~["
497
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff