yunyin007 commited on
Commit
66f80c5
·
verified ·
1 Parent(s): 748eaef

Upload folder using huggingface_hub

Browse files
config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "eos_token_id": [
9
+ 2,
10
+ 75864,
11
+ 75869
12
+ ],
13
+ "head_dim": 128,
14
+ "hidden_act": "silu",
15
+ "hidden_size": 5120,
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 27648,
18
+ "max_position_embeddings": 131072,
19
+ "mlp_bias": false,
20
+ "model_type": "llama",
21
+ "num_attention_heads": 40,
22
+ "num_hidden_layers": 14,
23
+ "num_key_value_heads": 8,
24
+ "pretraining_tp": 1,
25
+ "rms_norm_eps": 1e-05,
26
+ "rope_scaling": null,
27
+ "rope_theta": 500000,
28
+ "tie_word_embeddings": false,
29
+ "torch_dtype": "bfloat16",
30
+ "transformers_version": "4.40.0",
31
+ "use_cache": true,
32
+ "vocab_size": 76800
33
+ }
conversion_to_hf.log ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Loaded loader_megatron_core as the loader.
2
+ Loaded saver_llama2_hf_bf as the saver.
3
+ Starting saver...
4
+ Starting loader...
5
+ fused_indices_to_multihot has reached end of life. Please migrate to a non-experimental function.
6
+ /usr/local/lib/python3.12/dist-packages/modelopt/torch/utils/import_utils.py:31: UserWarning: Failed to import apex plugin due to: AttributeError("module 'transformers.modeling_utils' has no attribute 'Conv1D'"). You may ignore this warning if you do not need this plugin.
7
+ warnings.warn(
8
+ /usr/local/lib/python3.12/dist-packages/modelopt/torch/utils/import_utils.py:31: UserWarning: Failed to import huggingface plugin due to: AttributeError("module 'transformers.modeling_utils' has no attribute 'Conv1D'"). You may ignore this warning if you do not need this plugin.
9
+ warnings.warn(
10
+ /usr/local/lib/python3.12/dist-packages/modelopt/torch/utils/import_utils.py:31: UserWarning: Failed to import megatron plugin due to: AttributeError("module 'transformers.modeling_utils' has no attribute 'Conv1D'"). You may ignore this warning if you do not need this plugin.
11
+ warnings.warn(
12
+ Setting num_layers to 14 from checkpoint
13
+ Setting hidden_size to 5120 from checkpoint
14
+ Setting ffn_hidden_size to 27648 from checkpoint
15
+ Setting seq_length to 131072 from checkpoint
16
+ Setting num_attention_heads to 40 from checkpoint
17
+ Setting num_query_groups to 8 from checkpoint
18
+ Setting group_query_attention to True from checkpoint
19
+ Setting kv_channels to 128 from checkpoint
20
+ Setting max_position_embeddings to 131072 from checkpoint
21
+ Setting position_embedding_type to rope from checkpoint
22
+ Setting add_position_embedding to True from checkpoint
23
+ Setting use_rotary_position_embeddings to True from checkpoint
24
+ Setting rotary_base to 500000 from checkpoint
25
+ Setting rotary_percent to 1.0 from checkpoint
26
+ Setting rotary_interleaved to False from checkpoint
27
+ Setting add_bias_linear to False from checkpoint
28
+ Setting add_qkv_bias to False from checkpoint
29
+ Setting squared_relu to False from checkpoint
30
+ Setting swiglu to True from checkpoint
31
+ Setting untie_embeddings_and_output_weights to True from checkpoint
32
+ Setting apply_layernorm_1p to False from checkpoint
33
+ Setting normalization to RMSNorm from checkpoint
34
+ Setting apply_query_key_layer_scaling to False from checkpoint
35
+ Setting attention_dropout to 0.0 from checkpoint
36
+ Setting hidden_dropout to 0.0 from checkpoint
37
+ Checkpoint did not provide arguments hybrid_override_pattern
38
+ Checkpoint did not provide arguments spec
39
+ Setting hybrid_attention_ratio to 0.0 from checkpoint
40
+ Setting hybrid_mlp_ratio to 0.0 from checkpoint
41
+ Checkpoint did not provide arguments num_experts
42
+ Setting moe_layer_freq to 1 from checkpoint
43
+ Setting moe_router_topk to 2 from checkpoint
44
+ Setting moe_router_pre_softmax to False from checkpoint
45
+ Setting moe_grouped_gemm to False from checkpoint
46
+ Checkpoint did not provide arguments moe_shared_expert_intermediate_size
47
+ Setting mamba_state_dim to 128 from checkpoint
48
+ Setting mamba_head_dim to 64 from checkpoint
49
+ Setting mamba_num_groups to 8 from checkpoint
50
+ Checkpoint did not provide arguments mamba_num_heads
51
+ Setting is_hybrid_model to False from checkpoint
52
+ Checkpoint did not provide arguments heterogeneous_layers_config_path
53
+ Checkpoint did not provide arguments heterogeneous_layers_config_encoded_json
54
+ Setting tokenizer_type to SFTTokenizer from checkpoint
55
+ Setting tokenizer_model to /cpfs01/users/wzhang/iquest-coder-v1.1/RepoData-Ucoder-32B-128k-from2.5.2/97.09B_instruct_iquest-coder from checkpoint
56
+ Checkpoint did not provide arguments tiktoken_pattern
57
+ Setting padded_vocab_size to 76800 from checkpoint
58
+ INFO:megatron.core.num_microbatches_calculator:setting number of microbatches to constant 1
59
+ WARNING: one_logger package is required to enable e2e metrics tracking. please go to https://confluence.nvidia.com/display/MLWFO/Package+Repositories for details to install it
60
+ building GPT model ...
61
+ (TP, PP) mismatch after resume ((1, 1) vs (8, 1) from checkpoint): RNG state will be ignored
62
+ sharded_state_dict metadata loaded from the checkpoint: {'distrib_optim_sharding_type': 'dp_reshardable', 'singleton_local_shards': False, 'chained_optim_avoid_prefix': True}
63
+ Job sharding has changed: Rerun state will be ignored
64
+ loading distributed checkpoint from /tmp/megatron_convert_iter1947_node0_pid360_683c6438 at iteration 1947
65
+ /volume/pt-train/users/wzhang/wjj-workspace/code-sft/src/training/Megatron-LM/megatron/core/dist_checkpointing/strategies/torch.py:956: FutureWarning: `load_state_dict` is deprecated and will be removed in future versions. Please use `load` instead.
66
+ checkpoint.load_state_dict(
67
+ /usr/local/lib/python3.12/dist-packages/torch/distributed/checkpoint/planner_helpers.py:406: FutureWarning: Please use DTensor instead and we are deprecating ShardedTensor.
68
+ device = getattr(value, "device", None)
69
+ /usr/local/lib/python3.12/dist-packages/torch/distributed/checkpoint/default_planner.py:454: FutureWarning: Please use DTensor instead and we are deprecating ShardedTensor.
70
+ and md.size != obj.size()
71
+ checkpoint version 3.0
72
+ successfully loaded checkpoint from /tmp/megatron_convert_iter1947_node0_pid360_683c6438 [ t 1/1, p 1/1 ] at iteration 1947
73
+ sending embeddings
74
+ sending transformer layer 0
75
+ sending transformer layer 1
76
+ sending transformer layer 2
77
+ sending transformer layer 3
78
+ sending transformer layer 4
79
+ sending transformer layer 5
80
+ sending transformer layer 6
81
+ sending transformer layer 7
82
+ sending transformer layer 8
83
+ sending transformer layer 9
84
+ sending transformer layer 10
85
+ sending transformer layer 11
86
+ sending transformer layer 12
87
+ sending transformer layer 13
88
+ sending final norm
89
+ sending output layer
90
+ Waiting for saver to complete...
91
+ fused_indices_to_multihot has reached end of life. Please migrate to a non-experimental function.
92
+ received embeddings
93
+ received transformer layer 0
94
+ received transformer layer 1
95
+ received transformer layer 2
96
+ received transformer layer 3
97
+ received transformer layer 4
98
+ received transformer layer 5
99
+ received transformer layer 6
100
+ received transformer layer 7
101
+ received transformer layer 8
102
+ received transformer layer 9
103
+ received transformer layer 10
104
+ received transformer layer 11
105
+ received transformer layer 12
106
+ received transformer layer 13
107
+ received final norm
108
+ received output layer
109
+ Saving model to disk ...
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": [2, 75864, 75869],
5
+ "transformers_version": "4.55.4"
6
+ }
model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2f0112b3f9ebe9ed02524833b13821a2053b9ebc13570d34aa4490537178990
3
+ size 4813050528
model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8b7bd988e0a68cf00b8f2cca0f95dd3c5e57cfcf962eff61abbcf549492667c
3
+ size 4875986024
model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27af458be364bc2800eee25cd39838af7006ce6eb2a6f4ca6ec8d9075e4db120
3
+ size 4750166792
model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa6123d46a5b776fb9914f60d0cd23a0cdb4faf34b56a655e3160aedbb8b105b
3
+ size 786432128
model.safetensors.index.json ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_parameters": 7612810240,
4
+ "total_size": 15225620480
5
+ },
6
+ "weight_map": {
7
+ "lm_head.weight": "model-00004-of-00004.safetensors",
8
+ "model.embed_tokens.weight": "model-00001-of-00004.safetensors",
9
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
10
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
11
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
12
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
13
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
14
+ "model.layers.0.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
15
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
16
+ "model.layers.0.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
17
+ "model.layers.0.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
18
+ "model.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
19
+ "model.layers.1.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
20
+ "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
21
+ "model.layers.1.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
22
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
23
+ "model.layers.1.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
24
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
25
+ "model.layers.1.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
26
+ "model.layers.1.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
27
+ "model.layers.10.input_layernorm.weight": "model-00003-of-00004.safetensors",
28
+ "model.layers.10.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
29
+ "model.layers.10.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
30
+ "model.layers.10.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
31
+ "model.layers.10.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
32
+ "model.layers.10.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
33
+ "model.layers.10.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
34
+ "model.layers.10.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
35
+ "model.layers.10.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
36
+ "model.layers.11.input_layernorm.weight": "model-00003-of-00004.safetensors",
37
+ "model.layers.11.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
38
+ "model.layers.11.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
39
+ "model.layers.11.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
40
+ "model.layers.11.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
41
+ "model.layers.11.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
42
+ "model.layers.11.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
43
+ "model.layers.11.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
44
+ "model.layers.11.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
45
+ "model.layers.12.input_layernorm.weight": "model-00003-of-00004.safetensors",
46
+ "model.layers.12.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
47
+ "model.layers.12.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
48
+ "model.layers.12.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
49
+ "model.layers.12.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
50
+ "model.layers.12.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
51
+ "model.layers.12.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
52
+ "model.layers.12.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
53
+ "model.layers.12.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
54
+ "model.layers.13.input_layernorm.weight": "model-00003-of-00004.safetensors",
55
+ "model.layers.13.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
56
+ "model.layers.13.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
57
+ "model.layers.13.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
58
+ "model.layers.13.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
59
+ "model.layers.13.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
60
+ "model.layers.13.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
61
+ "model.layers.13.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
62
+ "model.layers.13.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
63
+ "model.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
64
+ "model.layers.2.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
65
+ "model.layers.2.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
66
+ "model.layers.2.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
67
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
68
+ "model.layers.2.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
69
+ "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
70
+ "model.layers.2.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
71
+ "model.layers.2.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
72
+ "model.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
73
+ "model.layers.3.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
74
+ "model.layers.3.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
75
+ "model.layers.3.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
76
+ "model.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
77
+ "model.layers.3.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
78
+ "model.layers.3.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
79
+ "model.layers.3.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
80
+ "model.layers.3.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
81
+ "model.layers.4.input_layernorm.weight": "model-00002-of-00004.safetensors",
82
+ "model.layers.4.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
83
+ "model.layers.4.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
84
+ "model.layers.4.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
85
+ "model.layers.4.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
86
+ "model.layers.4.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
87
+ "model.layers.4.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
88
+ "model.layers.4.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
89
+ "model.layers.4.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
90
+ "model.layers.5.input_layernorm.weight": "model-00002-of-00004.safetensors",
91
+ "model.layers.5.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
92
+ "model.layers.5.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
93
+ "model.layers.5.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
94
+ "model.layers.5.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
95
+ "model.layers.5.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
96
+ "model.layers.5.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
97
+ "model.layers.5.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
98
+ "model.layers.5.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
99
+ "model.layers.6.input_layernorm.weight": "model-00002-of-00004.safetensors",
100
+ "model.layers.6.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
101
+ "model.layers.6.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
102
+ "model.layers.6.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
103
+ "model.layers.6.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
104
+ "model.layers.6.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
105
+ "model.layers.6.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
106
+ "model.layers.6.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
107
+ "model.layers.6.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
108
+ "model.layers.7.input_layernorm.weight": "model-00002-of-00004.safetensors",
109
+ "model.layers.7.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
110
+ "model.layers.7.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
111
+ "model.layers.7.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
112
+ "model.layers.7.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
113
+ "model.layers.7.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
114
+ "model.layers.7.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
115
+ "model.layers.7.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
116
+ "model.layers.7.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
117
+ "model.layers.8.input_layernorm.weight": "model-00002-of-00004.safetensors",
118
+ "model.layers.8.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
119
+ "model.layers.8.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
120
+ "model.layers.8.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
121
+ "model.layers.8.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
122
+ "model.layers.8.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
123
+ "model.layers.8.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
124
+ "model.layers.8.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
125
+ "model.layers.8.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
126
+ "model.layers.9.input_layernorm.weight": "model-00003-of-00004.safetensors",
127
+ "model.layers.9.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
128
+ "model.layers.9.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
129
+ "model.layers.9.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
130
+ "model.layers.9.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
131
+ "model.layers.9.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
132
+ "model.layers.9.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
133
+ "model.layers.9.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
134
+ "model.layers.9.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
135
+ "model.norm.weight": "model-00003-of-00004.safetensors"
136
+ }
137
+ }
tokenization_neo.py ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2024 NEO Inc. All Rights Reserved.
2
+
3
+ # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
4
+ #
5
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
6
+ # and OPT implementations in this library. It has been modified from its
7
+ # original forms to accommodate minor architectural differences compared
8
+ # to GPT-NeoX and OPT used by the Meta AI team that trained the model.
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
+ import os
23
+ from shutil import copyfile
24
+ from typing import Any, Dict, List, Optional, Tuple
25
+
26
+ import sentencepiece as spm
27
+
28
+ from transformers.tokenization_utils import AddedToken, PreTrainedTokenizer
29
+ from transformers.utils import logging
30
+
31
+
32
+ logger = logging.get_logger(__name__)
33
+
34
+ VOCAB_FILES_NAMES = {"vocab_file": "tokenizer.model"}
35
+
36
+ PRETRAINED_VOCAB_FILES_MAP = {
37
+ "vocab_file": {},
38
+ "tokenizer_file": {},
39
+ }
40
+ PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {}
41
+
42
+
43
+ class NEOTokenizer(PreTrainedTokenizer):
44
+ """
45
+ Construct a NEO tokenizer. Based on byte-level Byte-Pair-Encoding.
46
+ Args:
47
+ vocab_file (`str`):
48
+ Path to the vocabulary file.
49
+ """
50
+
51
+ vocab_files_names = VOCAB_FILES_NAMES
52
+ pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP
53
+ max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
54
+ model_input_names = ["input_ids", "attention_mask"]
55
+
56
+ def __init__(
57
+ self,
58
+ vocab_file,
59
+ unk_token="<unk>",
60
+ bos_token="<s>",
61
+ eos_token="</s>",
62
+ pad_token=None,
63
+ sp_model_kwargs: Optional[Dict[str, Any]] = None,
64
+ add_bos_token=True,
65
+ add_eos_token=False,
66
+ clean_up_tokenization_spaces=False,
67
+ **kwargs,
68
+ ):
69
+ self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
70
+ bos_token = AddedToken(bos_token, lstrip=False, rstrip=False) if isinstance(bos_token, str) else bos_token
71
+ eos_token = AddedToken(eos_token, lstrip=False, rstrip=False) if isinstance(eos_token, str) else eos_token
72
+ unk_token = AddedToken(unk_token, lstrip=False, rstrip=False) if isinstance(unk_token, str) else unk_token
73
+ pad_token = AddedToken(pad_token, lstrip=False, rstrip=False) if isinstance(pad_token, str) else pad_token
74
+
75
+ self.vocab_file = vocab_file
76
+ self.add_bos_token = add_bos_token
77
+ self.add_eos_token = add_eos_token
78
+ self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
79
+ self.sp_model.Load(vocab_file)
80
+
81
+ super().__init__(
82
+ bos_token=bos_token,
83
+ eos_token=eos_token,
84
+ unk_token=unk_token,
85
+ pad_token=pad_token,
86
+ add_bos_token=add_bos_token,
87
+ add_eos_token=add_eos_token,
88
+ sp_model_kwargs=self.sp_model_kwargs,
89
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
90
+ **kwargs,
91
+ )
92
+
93
+ def __getstate__(self):
94
+ state = self.__dict__.copy()
95
+ state["sp_model"] = None
96
+ return state
97
+
98
+ def __setstate__(self, d):
99
+ self.__dict__ = d
100
+ self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
101
+ self.sp_model.Load(self.vocab_file)
102
+
103
+ @property
104
+ def vocab_size(self):
105
+ """Returns vocab size"""
106
+ return self.sp_model.get_piece_size()
107
+
108
+ def get_vocab(self):
109
+ """Returns vocab as a dict"""
110
+ vocab = {self.convert_ids_to_tokens(i): i for i in range(self.vocab_size)}
111
+ vocab.update(self.added_tokens_encoder)
112
+ return vocab
113
+
114
+ def _tokenize(self, text):
115
+ """Returns a tokenized string."""
116
+ return self.sp_model.encode(text, out_type=str)
117
+
118
+ def _convert_token_to_id(self, token):
119
+ """Converts a token (str) in an id using the vocab."""
120
+ return self.sp_model.piece_to_id(token)
121
+
122
+ def _convert_id_to_token(self, index):
123
+ """Converts an index (integer) in a token (str) using the vocab."""
124
+ token = self.sp_model.IdToPiece(index)
125
+ return token
126
+
127
+ def convert_tokens_to_string(self, tokens):
128
+ """Converts a sequence of tokens (string) in a single string."""
129
+ current_sub_tokens = []
130
+ out_string = ""
131
+ prev_is_special = False
132
+ for i, token in enumerate(tokens):
133
+ # make sure that special tokens are not decoded using sentencepiece model
134
+ if token in self.all_special_tokens:
135
+ if not prev_is_special and i != 0:
136
+ out_string += " "
137
+ out_string += self.sp_model.decode(current_sub_tokens) + token
138
+ prev_is_special = True
139
+ current_sub_tokens = []
140
+ else:
141
+ current_sub_tokens.append(token)
142
+ prev_is_special = False
143
+ out_string += self.sp_model.decode(current_sub_tokens)
144
+ return out_string
145
+
146
+ def save_vocabulary(self, save_directory, filename_prefix: Optional[str] = None) -> Tuple[str]:
147
+ """
148
+ Save the vocabulary and special tokens file to a directory.
149
+ Args:
150
+ save_directory (`str`):
151
+ The directory in which to save the vocabulary.
152
+ Returns:
153
+ `Tuple(str)`: Paths to the files saved.
154
+ """
155
+ if not os.path.isdir(save_directory):
156
+ logger.error(f"Vocabulary path ({save_directory}) should be a directory")
157
+ return
158
+ out_vocab_file = os.path.join(
159
+ save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
160
+ )
161
+
162
+ if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file) and os.path.isfile(self.vocab_file):
163
+ copyfile(self.vocab_file, out_vocab_file)
164
+ elif not os.path.isfile(self.vocab_file):
165
+ with open(out_vocab_file, "wb") as fi:
166
+ content_spiece_model = self.sp_model.serialized_model_proto()
167
+ fi.write(content_spiece_model)
168
+
169
+ return (out_vocab_file,)
170
+
171
+ def build_inputs_with_special_tokens(self, token_ids_0, token_ids_1=None):
172
+ bos_token_id = [self.bos_token_id] if self.add_bos_token else []
173
+ eos_token_id = [self.eos_token_id] if self.add_eos_token else []
174
+
175
+ output = bos_token_id + token_ids_0 + eos_token_id
176
+
177
+ if token_ids_1 is not None:
178
+ output = output + bos_token_id + token_ids_1 + eos_token_id
179
+
180
+ return output
181
+
182
+ def get_special_tokens_mask(
183
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None, already_has_special_tokens: bool = False
184
+ ) -> List[int]:
185
+ """
186
+ Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
187
+ special tokens using the tokenizer `prepare_for_model` method.
188
+ Args:
189
+ token_ids_0 (`List[int]`):
190
+ List of IDs.
191
+ token_ids_1 (`List[int]`, *optional*):
192
+ Optional second list of IDs for sequence pairs.
193
+ already_has_special_tokens (`bool`, *optional*, defaults to `False`):
194
+ Whether or not the token list is already formatted with special tokens for the model.
195
+ Returns:
196
+ `List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
197
+ """
198
+ if already_has_special_tokens:
199
+ return super().get_special_tokens_mask(
200
+ token_ids_0=token_ids_0, token_ids_1=token_ids_1, already_has_special_tokens=True
201
+ )
202
+
203
+ bos_token_id = [1] if self.add_bos_token else []
204
+ eos_token_id = [1] if self.add_eos_token else []
205
+
206
+ if token_ids_1 is None:
207
+ return bos_token_id + ([0] * len(token_ids_0)) + eos_token_id
208
+ return (
209
+ bos_token_id
210
+ + ([0] * len(token_ids_0))
211
+ + eos_token_id
212
+ + bos_token_id
213
+ + ([0] * len(token_ids_1))
214
+ + eos_token_id
215
+ )
216
+
217
+ def create_token_type_ids_from_sequences(
218
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None
219
+ ) -> List[int]:
220
+ """
221
+ Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT
222
+ sequence pair mask has the following format:
223
+ ```
224
+ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
225
+ | first sequence | second sequence |
226
+ ```
227
+ if token_ids_1 is None, only returns the first portion of the mask (0s).
228
+ Args:
229
+ token_ids_0 (`List[int]`):
230
+ List of ids.
231
+ token_ids_1 (`List[int]`, *optional*):
232
+ Optional second list of IDs for sequence pairs.
233
+ Returns:
234
+ `List[int]`: List of [token type IDs](../glossary#token-type-ids) according to the given sequence(s).
235
+ """
236
+ bos_token_id = [self.bos_token_id] if self.add_bos_token else []
237
+ eos_token_id = [self.eos_token_id] if self.add_eos_token else []
238
+
239
+ output = [0] * len(bos_token_id + token_ids_0 + eos_token_id)
240
+
241
+ if token_ids_1 is not None:
242
+ output += [1] * len(bos_token_id + token_ids_1 + eos_token_id)
243
+
244
+ return output
245
+
246
+
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d3be68e090a927f31e0e378d7599b15c206dd47e4a73933775a746cc9c1cd91
3
+ size 1345108
tokenizer_config.json ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": true,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": true,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": true,
25
+ "rstrip": false,
26
+ "single_word": true,
27
+ "special": true
28
+ },
29
+ "75858": {
30
+ "content": "<CLS>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "75859": {
38
+ "content": "<SEP>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "75860": {
46
+ "content": "<EOD>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "75861": {
54
+ "content": "<MASK>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "75862": {
62
+ "content": "<PAD>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "75863": {
70
+ "content": "<|im_start|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "75864": {
78
+ "content": "<|im_end|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "75865": {
86
+ "content": "<|fim_prefix|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "75866": {
94
+ "content": "<|fim_middle|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "75867": {
102
+ "content": "<|fim_suffix|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "75868": {
110
+ "content": "<|fim_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "75869": {
118
+ "content": "<|endoftext|>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": true
124
+ },
125
+ "75870": {
126
+ "content": "<|repo_name|>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": true
132
+ },
133
+ "75871": {
134
+ "content": "<|file_sep|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": true
140
+ },
141
+ "75872": {
142
+ "content": "<think>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "75873": {
150
+ "content": "</think>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "75874": {
158
+ "content": "<tools>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "75875": {
166
+ "content": "</tools>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "75876": {
174
+ "content": "<tool_call>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ },
181
+ "75877": {
182
+ "content": "</tool_call>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": false
188
+ },
189
+ "75878": {
190
+ "content": "<tool_response>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": false
196
+ },
197
+ "75879": {
198
+ "content": "</tool_response>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": false
204
+ }
205
+ },
206
+ "additional_special_tokens": [
207
+ "<|CLS|>",
208
+ "<|SEP|>",
209
+ "<|EOD|>",
210
+ "<|MASK|>",
211
+ "<|PAD|>",
212
+ "<|fim_prefix|>",
213
+ "<|fim_middle|>",
214
+ "<|fim_suffix|>",
215
+ "<|im_start|>",
216
+ "<|im_end|>",
217
+ "<|fim_pad|>",
218
+ "<|endoftext|>",
219
+ "<|repo_name|>",
220
+ "<|file_sep|>"
221
+ ],
222
+ "auto_map": {
223
+ "AutoTokenizer": [
224
+ "tokenization_neo.NEOTokenizer",
225
+ null
226
+ ]
227
+ },
228
+ "bos_token": "<s>",
229
+ "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- else %}\n {{- 'You are IQuest-Coder, a helpful assistant developed by IQuest.' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou have access to the following functions:\\n\\n<tools>\" }}\n {%- for tool in tools %}\n {%- if tool.type == 'function' and tool.function %}\n {%- set func = tool.function %}\n {%- else %}\n {%- set func = tool %}\n {%- endif %}\n {{- \"\\n<function>\\n<name>\" + func.name + \"</name>\" }}\n {%- if func.description %}\n {{- \"\\n<description>\" + func.description + \"</description>\" }}\n {%- endif %}\n {{- \"\\n<parameters>\" }}\n {%- if func.parameters and func.parameters.properties %}\n {%- for param_name, param_fields in func.parameters.properties.items() %}\n {{- \"\\n<parameter>\" }}\n {{- \"\\n<name>\" + param_name + \"</name>\" }}\n {%- if param_fields.type %}\n {{- \"\\n<type>\" + param_fields.type + \"</type>\" }}\n {%- endif %}\n {%- if param_fields.description %}\n {{- \"\\n<description>\" + param_fields.description + \"</description>\" }}\n {%- endif %}\n {{- \"\\n</parameter>\" }}\n {%- endfor %}\n {%- endif %}\n {{- \"\\n</parameters>\\n</function>\" }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nIf you choose to call a function ONLY reply in the following format:\\n\\n<tool_call>\\n<function=example_function_name>\\n<parameter=example_parameter_1>\\nvalue_1\\n</parameter>\\n</function>\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are IQuest-Coder, a helpful assistant developed by IQuest.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set content = message.content %}\n {%- set reasoning_content = '' %}\n {%- set has_think = false %}\n {%- if message.reasoning_content is defined and message.reasoning_content is not none %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- set has_think = true %}\n {%- else %}\n {%- if '</think>' in message.content %}\n {%- set content = message.content.split('</think>')[-1].lstrip('\\n') %}\n {%- set reasoning_content = message.content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set has_think = true %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and has_think) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {%- if has_think %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tc = tool_call.function %}\n {%- else %}\n {%- set tc = tool_call %}\n {%- endif %}\n {{- '<tool_call>\\n<function=' + tc.name + '>\\n' }}\n {%- if tc.arguments is string %}\n {%- set args = tc.arguments | fromjson %}\n {%- else %}\n {%- set args = tc.arguments %}\n {%- endif %}\n {%- for arg_name, arg_value in args.items() %}\n {{- '<parameter=' + arg_name + '>\\n' }}\n {%- if arg_value is string %}\n {{- arg_value }}\n {%- else %}\n {{- arg_value | tojson }}\n {%- endif %}\n {{- '\\n</parameter>\\n' }}\n {%- endfor %}\n {{- '</function>\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}",
230
+ "clean_up_tokenization_spaces": false,
231
+ "eos_token": "<|im_end|>",
232
+ "model_max_length": 131072,
233
+ "pad_token": "<|endoftext|>",
234
+ "padding_side": "right",
235
+ "sp_model_kwargs": {},
236
+ "split_special_tokens": false,
237
+ "tokenizer_class": "NEOTokenizer",
238
+ "unk_token": "<unk>",
239
+ "use_fast": false
240
+ }