File tree Expand file tree Collapse file tree
utils/ckpt_conversion/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Copyright 2023–2025 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # https://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ # model config for qwen3-4b-Thinking-2507
16+
17+ base_emb_dim : 2560
18+ base_num_query_heads : 32
19+ base_num_kv_heads : 8
20+ base_mlp_dim : 9728
21+ base_num_decoder_layers : 36
22+ head_dim : 128
23+ mlp_activations : ["silu", "linear"] # "hidden_act": "silu" implies SwiGLU
24+ vocab_size : 151936
25+
26+ decoder_block : " qwen3"
27+
28+ normalization_layer_epsilon : 1.0e-6
29+ rope_max_timescale : 5000000
30+
31+ use_qk_norm : True
32+
33+ logits_via_embedding : True # from "tie_word_embeddings": true
34+ normalize_embedding_logits : False
35+ enable_dropout : False # deterministic for testing
36+
Original file line number Diff line number Diff line change @@ -384,6 +384,7 @@ def validate_model_name(s: str) -> bool:
384384 "gemma3-27b" ,
385385 "qwen3-0.6b" ,
386386 "qwen3-4b" ,
387+ "qwen3-4b-thinking-2507" ,
387388 "qwen3-8b" ,
388389 "qwen3-14b" ,
389390 "qwen3-32b" ,
Original file line number Diff line number Diff line change 478478 "gemma3-27b" : gemma3_27b_config ,
479479 "qwen3-0.6b" : qwen3_0_6b_config ,
480480 "qwen3-4b" : qwen3_4b_config ,
481+ "qwen3-4b-thinking-2507" : qwen3_4b_config ,
481482 "qwen3-8b" : qwen3_8b_config ,
482483 "qwen3-14b" : qwen3_14b_config ,
483484 "qwen3-32b" : qwen3_32b_config ,
Original file line number Diff line number Diff line change @@ -371,6 +371,7 @@ def LLAMA31_HF_WEIGHTS_TO_SHAPE(config):
371371 "gemma3-27b" : GEMMA3_HF_WEIGHTS_TO_SHAPE ,
372372 "qwen3-0.6b" : QWEN3_HF_WEIGHTS_TO_SHAPE ,
373373 "qwen3-4b" : QWEN3_HF_WEIGHTS_TO_SHAPE ,
374+ "qwen3-4b-thinking-2507" : QWEN3_HF_WEIGHTS_TO_SHAPE ,
374375 "qwen3-8b" : QWEN3_HF_WEIGHTS_TO_SHAPE ,
375376 "qwen3-14b" : QWEN3_HF_WEIGHTS_TO_SHAPE ,
376377 "qwen3-32b" : QWEN3_HF_WEIGHTS_TO_SHAPE ,
Original file line number Diff line number Diff line change @@ -997,6 +997,7 @@ def from_hf():
997997 "gemma3-27b" : GEMMA3_MAXTEXT_TO_HF_PARAM_MAPPING ,
998998 "qwen3-0.6b" : QWEN3_MAXTEXT_TO_HF_PARAM_MAPPING ,
999999 "qwen3-4b" : QWEN3_MAXTEXT_TO_HF_PARAM_MAPPING ,
1000+ "qwen3-4b-thinking-2507" : QWEN3_MAXTEXT_TO_HF_PARAM_MAPPING ,
10001001 "qwen3-8b" : QWEN3_MAXTEXT_TO_HF_PARAM_MAPPING ,
10011002 "qwen3-14b" : QWEN3_MAXTEXT_TO_HF_PARAM_MAPPING ,
10021003 "qwen3-32b" : QWEN3_MAXTEXT_TO_HF_PARAM_MAPPING ,
@@ -1017,6 +1018,7 @@ def from_hf():
10171018 "gemma3-27b" : GEMMA3_MAXTEXT_TO_HF_PARAM_HOOK_FN ,
10181019 "qwen3-0.6b" : QWEN3_MAXTEXT_TO_HF_PARAM_HOOK_FN ,
10191020 "qwen3-4b" : QWEN3_MAXTEXT_TO_HF_PARAM_HOOK_FN ,
1021+ "qwen3-4b-thinking-2507" : QWEN3_MAXTEXT_TO_HF_PARAM_HOOK_FN ,
10201022 "qwen3-8b" : QWEN3_MAXTEXT_TO_HF_PARAM_HOOK_FN ,
10211023 "qwen3-14b" : QWEN3_MAXTEXT_TO_HF_PARAM_HOOK_FN ,
10221024 "qwen3-32b" : QWEN3_MAXTEXT_TO_HF_PARAM_HOOK_FN ,
Original file line number Diff line number Diff line change 6060 "gemma3-27b" : "google/gemma-3-27b-it" ,
6161 "qwen3-0.6b" : "Qwen/Qwen3-0.6B" ,
6262 "qwen3-4b" : "Qwen/Qwen3-4B" ,
63+ "qwen3-4b-thinking-2507" : "Qwen/Qwen3-4B-Thinking-2507" ,
6364 "qwen3-8b" : "Qwen/Qwen3-8B" ,
6465 "qwen3-14b" : "Qwen/Qwen3-14B" ,
6566 "qwen3-32b" : "Qwen/Qwen3-32B" ,
You can’t perform that action at this time.
0 commit comments