Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- added_tokens.json +11 -0
- config.json +204 -0
- generation_config.json +8 -0
- lora_weights.pth +3 -0
- model-00001-of-00004.safetensors +3 -0
- model-00002-of-00004.safetensors +3 -0
- model-00003-of-00004.safetensors +3 -0
- model-00004-of-00004.safetensors +3 -0
- model.safetensors.index.json +0 -0
- qa_metrics.txt +9 -0
- qa_results.csv +0 -0
- runs/Jun05_16-24-50_amax/events.out.tfevents.1749111897.amax.3404852.0 +3 -0
- runs/Jun05_16-27-27_amax/events.out.tfevents.1749112053.amax.3407478.0 +3 -0
- runs/Jun05_16-27-58_amax/events.out.tfevents.1749112084.amax.3409022.0 +3 -0
- runs/Jun05_16-32-11_amax/events.out.tfevents.1749112338.amax.3414799.0 +3 -0
- runs/Jun05_16-32-42_amax/events.out.tfevents.1749112368.amax.3416458.0 +3 -0
- special_tokens_map.json +47 -0
- tokenization_internlm2.py +235 -0
- tokenizer.model +3 -0
- tokenizer_config.json +180 -0
- training_args.bin +3 -0
- training_log.txt +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
training_log.txt filter=lfs diff=lfs merge=lfs -text
|
added_tokens.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"</box>": 92552,
|
| 3 |
+
"</img>": 92545,
|
| 4 |
+
"</quad>": 92548,
|
| 5 |
+
"</ref>": 92550,
|
| 6 |
+
"<IMG_CONTEXT>": 92546,
|
| 7 |
+
"<box>": 92551,
|
| 8 |
+
"<img>": 92544,
|
| 9 |
+
"<quad>": 92547,
|
| 10 |
+
"<ref>": 92549
|
| 11 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_commit_hash": null,
|
| 3 |
+
"_name_or_path": "/mnt/data/wjr/OpenGVLab/InternVL2_5-8B",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"InternVLChatModel"
|
| 6 |
+
],
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "configuration_internvl_chat.InternVLChatConfig",
|
| 9 |
+
"AutoModel": "modeling_internvl_chat.InternVLChatModel",
|
| 10 |
+
"AutoModelForCausalLM": "modeling_internvl_chat.InternVLChatModel"
|
| 11 |
+
},
|
| 12 |
+
"downsample_ratio": 0.5,
|
| 13 |
+
"dynamic_image_size": true,
|
| 14 |
+
"force_image_size": 448,
|
| 15 |
+
"llm_config": {
|
| 16 |
+
"_attn_implementation_autoset": true,
|
| 17 |
+
"_name_or_path": "internlm/internlm2_5-7b-chat",
|
| 18 |
+
"add_cross_attention": false,
|
| 19 |
+
"architectures": [
|
| 20 |
+
"InternLM2ForCausalLM"
|
| 21 |
+
],
|
| 22 |
+
"attn_implementation": "flash_attention_2",
|
| 23 |
+
"auto_map": {
|
| 24 |
+
"AutoConfig": "configuration_internlm2.InternLM2Config",
|
| 25 |
+
"AutoModel": "modeling_internlm2.InternLM2ForCausalLM",
|
| 26 |
+
"AutoModelForCausalLM": "modeling_internlm2.InternLM2ForCausalLM",
|
| 27 |
+
"AutoModelForSequenceClassification": "modeling_internlm2.InternLM2ForSequenceClassification"
|
| 28 |
+
},
|
| 29 |
+
"bad_words_ids": null,
|
| 30 |
+
"begin_suppress_tokens": null,
|
| 31 |
+
"bias": false,
|
| 32 |
+
"bos_token_id": 1,
|
| 33 |
+
"chunk_size_feed_forward": 0,
|
| 34 |
+
"cross_attention_hidden_size": null,
|
| 35 |
+
"decoder_start_token_id": null,
|
| 36 |
+
"diversity_penalty": 0.0,
|
| 37 |
+
"do_sample": false,
|
| 38 |
+
"early_stopping": false,
|
| 39 |
+
"encoder_no_repeat_ngram_size": 0,
|
| 40 |
+
"eos_token_id": 2,
|
| 41 |
+
"exponential_decay_length_penalty": null,
|
| 42 |
+
"finetuning_task": null,
|
| 43 |
+
"forced_bos_token_id": null,
|
| 44 |
+
"forced_eos_token_id": null,
|
| 45 |
+
"hidden_act": "silu",
|
| 46 |
+
"hidden_size": 4096,
|
| 47 |
+
"id2label": {
|
| 48 |
+
"0": "LABEL_0",
|
| 49 |
+
"1": "LABEL_1"
|
| 50 |
+
},
|
| 51 |
+
"initializer_range": 0.02,
|
| 52 |
+
"intermediate_size": 14336,
|
| 53 |
+
"is_decoder": false,
|
| 54 |
+
"is_encoder_decoder": false,
|
| 55 |
+
"label2id": {
|
| 56 |
+
"LABEL_0": 0,
|
| 57 |
+
"LABEL_1": 1
|
| 58 |
+
},
|
| 59 |
+
"length_penalty": 1.0,
|
| 60 |
+
"max_length": 20,
|
| 61 |
+
"max_position_embeddings": 32768,
|
| 62 |
+
"min_length": 0,
|
| 63 |
+
"model_type": "internlm2",
|
| 64 |
+
"no_repeat_ngram_size": 0,
|
| 65 |
+
"num_attention_heads": 32,
|
| 66 |
+
"num_beam_groups": 1,
|
| 67 |
+
"num_beams": 1,
|
| 68 |
+
"num_hidden_layers": 32,
|
| 69 |
+
"num_key_value_heads": 8,
|
| 70 |
+
"num_return_sequences": 1,
|
| 71 |
+
"output_attentions": false,
|
| 72 |
+
"output_hidden_states": false,
|
| 73 |
+
"output_scores": false,
|
| 74 |
+
"pad_token_id": 2,
|
| 75 |
+
"prefix": null,
|
| 76 |
+
"pretraining_tp": 1,
|
| 77 |
+
"problem_type": null,
|
| 78 |
+
"pruned_heads": {},
|
| 79 |
+
"remove_invalid_values": false,
|
| 80 |
+
"repetition_penalty": 1.0,
|
| 81 |
+
"return_dict": true,
|
| 82 |
+
"return_dict_in_generate": false,
|
| 83 |
+
"rms_norm_eps": 1e-05,
|
| 84 |
+
"rope_scaling": {
|
| 85 |
+
"factor": 2.0,
|
| 86 |
+
"type": "dynamic"
|
| 87 |
+
},
|
| 88 |
+
"rope_theta": 1000000,
|
| 89 |
+
"sep_token_id": null,
|
| 90 |
+
"suppress_tokens": null,
|
| 91 |
+
"task_specific_params": null,
|
| 92 |
+
"temperature": 1.0,
|
| 93 |
+
"tf_legacy_loss": false,
|
| 94 |
+
"tie_encoder_decoder": false,
|
| 95 |
+
"tie_word_embeddings": false,
|
| 96 |
+
"tokenizer_class": null,
|
| 97 |
+
"top_k": 50,
|
| 98 |
+
"top_p": 1.0,
|
| 99 |
+
"torch_dtype": "bfloat16",
|
| 100 |
+
"torchscript": false,
|
| 101 |
+
"transformers_version": "4.48.3",
|
| 102 |
+
"typical_p": 1.0,
|
| 103 |
+
"use_bfloat16": true,
|
| 104 |
+
"use_cache": false,
|
| 105 |
+
"vocab_size": 92553
|
| 106 |
+
},
|
| 107 |
+
"max_dynamic_patch": 6,
|
| 108 |
+
"min_dynamic_patch": 1,
|
| 109 |
+
"model_type": "internvl_chat",
|
| 110 |
+
"pad2square": false,
|
| 111 |
+
"ps_version": "v2",
|
| 112 |
+
"select_layer": -1,
|
| 113 |
+
"template": "internlm2-chat",
|
| 114 |
+
"torch_dtype": "bfloat16",
|
| 115 |
+
"transformers_version": null,
|
| 116 |
+
"use_backbone_lora": 8,
|
| 117 |
+
"use_llm_lora": 8,
|
| 118 |
+
"use_thumbnail": true,
|
| 119 |
+
"vision_config": {
|
| 120 |
+
"_attn_implementation_autoset": true,
|
| 121 |
+
"_name_or_path": "",
|
| 122 |
+
"add_cross_attention": false,
|
| 123 |
+
"architectures": [
|
| 124 |
+
"InternVisionModel"
|
| 125 |
+
],
|
| 126 |
+
"attention_dropout": 0.0,
|
| 127 |
+
"bad_words_ids": null,
|
| 128 |
+
"begin_suppress_tokens": null,
|
| 129 |
+
"bos_token_id": null,
|
| 130 |
+
"chunk_size_feed_forward": 0,
|
| 131 |
+
"cross_attention_hidden_size": null,
|
| 132 |
+
"decoder_start_token_id": null,
|
| 133 |
+
"diversity_penalty": 0.0,
|
| 134 |
+
"do_sample": false,
|
| 135 |
+
"drop_path_rate": 0.1,
|
| 136 |
+
"dropout": 0.0,
|
| 137 |
+
"early_stopping": false,
|
| 138 |
+
"encoder_no_repeat_ngram_size": 0,
|
| 139 |
+
"eos_token_id": null,
|
| 140 |
+
"exponential_decay_length_penalty": null,
|
| 141 |
+
"finetuning_task": null,
|
| 142 |
+
"forced_bos_token_id": null,
|
| 143 |
+
"forced_eos_token_id": null,
|
| 144 |
+
"hidden_act": "gelu",
|
| 145 |
+
"hidden_size": 1024,
|
| 146 |
+
"id2label": {
|
| 147 |
+
"0": "LABEL_0",
|
| 148 |
+
"1": "LABEL_1"
|
| 149 |
+
},
|
| 150 |
+
"image_size": 448,
|
| 151 |
+
"initializer_factor": 1.0,
|
| 152 |
+
"initializer_range": 0.02,
|
| 153 |
+
"intermediate_size": 4096,
|
| 154 |
+
"is_decoder": false,
|
| 155 |
+
"is_encoder_decoder": false,
|
| 156 |
+
"label2id": {
|
| 157 |
+
"LABEL_0": 0,
|
| 158 |
+
"LABEL_1": 1
|
| 159 |
+
},
|
| 160 |
+
"layer_norm_eps": 1e-06,
|
| 161 |
+
"length_penalty": 1.0,
|
| 162 |
+
"max_length": 20,
|
| 163 |
+
"min_length": 0,
|
| 164 |
+
"model_type": "intern_vit_6b",
|
| 165 |
+
"no_repeat_ngram_size": 0,
|
| 166 |
+
"norm_type": "layer_norm",
|
| 167 |
+
"num_attention_heads": 16,
|
| 168 |
+
"num_beam_groups": 1,
|
| 169 |
+
"num_beams": 1,
|
| 170 |
+
"num_channels": 3,
|
| 171 |
+
"num_hidden_layers": 24,
|
| 172 |
+
"num_return_sequences": 1,
|
| 173 |
+
"output_attentions": false,
|
| 174 |
+
"output_hidden_states": false,
|
| 175 |
+
"output_scores": false,
|
| 176 |
+
"pad_token_id": null,
|
| 177 |
+
"patch_size": 14,
|
| 178 |
+
"prefix": null,
|
| 179 |
+
"problem_type": null,
|
| 180 |
+
"pruned_heads": {},
|
| 181 |
+
"qk_normalization": false,
|
| 182 |
+
"qkv_bias": true,
|
| 183 |
+
"remove_invalid_values": false,
|
| 184 |
+
"repetition_penalty": 1.0,
|
| 185 |
+
"return_dict": true,
|
| 186 |
+
"return_dict_in_generate": false,
|
| 187 |
+
"sep_token_id": null,
|
| 188 |
+
"suppress_tokens": null,
|
| 189 |
+
"task_specific_params": null,
|
| 190 |
+
"temperature": 1.0,
|
| 191 |
+
"tf_legacy_loss": false,
|
| 192 |
+
"tie_encoder_decoder": false,
|
| 193 |
+
"tie_word_embeddings": true,
|
| 194 |
+
"tokenizer_class": null,
|
| 195 |
+
"top_k": 50,
|
| 196 |
+
"top_p": 1.0,
|
| 197 |
+
"torch_dtype": "bfloat16",
|
| 198 |
+
"torchscript": false,
|
| 199 |
+
"transformers_version": "4.48.3",
|
| 200 |
+
"typical_p": 1.0,
|
| 201 |
+
"use_bfloat16": true,
|
| 202 |
+
"use_flash_attn": true
|
| 203 |
+
}
|
| 204 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
92542,
|
| 5 |
+
92543
|
| 6 |
+
],
|
| 7 |
+
"transformers_version": "4.48.3"
|
| 8 |
+
}
|
lora_weights.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f107e7ea7de8599050d2a91f9d213d6e1b76026411d4cd13af6d866107202325
|
| 3 |
+
size 44227206
|
model-00001-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6c18981de96bedd67e6c4eaecf2e3d5fb1a8d40ee2e42021b5c078195016772b
|
| 3 |
+
size 4956020024
|
model-00002-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e626c95d169e73ab4282e65e873730285c7c2e1ddd7775911cc3319ee692445e
|
| 3 |
+
size 4929205472
|
model-00003-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:30fc3e0ddac63d194544ff81e5e927a65f9a624305118c2acfa91c0c51204477
|
| 3 |
+
size 4929205512
|
model-00004-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b503d293af7124863a98937c81631cff90bee2b5317414fefb19d696542da09c
|
| 3 |
+
size 1380503656
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
qa_metrics.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Accuracy: 0.6002662590602041
|
| 2 |
+
Accuracy: 0.6002662590602041
|
| 3 |
+
Accuracy: 0.6142695133376066
|
| 4 |
+
Accuracy: 0.6142695133376066
|
| 5 |
+
Accuracy: 0.6304915931167102
|
| 6 |
+
Accuracy: 0.6304915931167102
|
| 7 |
+
Accuracy: 0.6358167743207929
|
| 8 |
+
Accuracy: 0.6358167743207929
|
| 9 |
+
Accuracy: 0.6318228884177309
|
qa_results.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
runs/Jun05_16-24-50_amax/events.out.tfevents.1749111897.amax.3404852.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c6a2b3c08a5a79974ea2a350bad17b6eebbdddb9777901bbb92058ed6477f0f2
|
| 3 |
+
size 11190
|
runs/Jun05_16-27-27_amax/events.out.tfevents.1749112053.amax.3407478.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65c26352ed9568035a436202bea82901bb5a03f6d1ba65e9a2d127745806bed9
|
| 3 |
+
size 10155
|
runs/Jun05_16-27-58_amax/events.out.tfevents.1749112084.amax.3409022.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ea0388f70962073d2d8c3b25656f52c5f79db31263b55cceaf39ae8fd46e638b
|
| 3 |
+
size 27129
|
runs/Jun05_16-32-11_amax/events.out.tfevents.1749112338.amax.3414799.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0e546f7d7449b1fd48251d123025a0ae13285a47052b30b0852b6cf0f1bc57ca
|
| 3 |
+
size 21746190
|
runs/Jun05_16-32-42_amax/events.out.tfevents.1749112368.amax.3416458.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61bc2d5a4110d26be0fa29522837eaece291d7f2bcf48b899db1c0a66a1634cf
|
| 3 |
+
size 10155
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
"<|im_start|>",
|
| 4 |
+
"<|im_end|>",
|
| 5 |
+
"<|action_start|>",
|
| 6 |
+
"<|action_end|>",
|
| 7 |
+
"<|interpreter|>",
|
| 8 |
+
"<|plugin|>",
|
| 9 |
+
"<img>",
|
| 10 |
+
"</img>",
|
| 11 |
+
"<IMG_CONTEXT>",
|
| 12 |
+
"<quad>",
|
| 13 |
+
"</quad>",
|
| 14 |
+
"<ref>",
|
| 15 |
+
"</ref>",
|
| 16 |
+
"<box>",
|
| 17 |
+
"</box>"
|
| 18 |
+
],
|
| 19 |
+
"bos_token": {
|
| 20 |
+
"content": "<s>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false
|
| 25 |
+
},
|
| 26 |
+
"eos_token": {
|
| 27 |
+
"content": "</s>",
|
| 28 |
+
"lstrip": false,
|
| 29 |
+
"normalized": false,
|
| 30 |
+
"rstrip": false,
|
| 31 |
+
"single_word": false
|
| 32 |
+
},
|
| 33 |
+
"pad_token": {
|
| 34 |
+
"content": "</s>",
|
| 35 |
+
"lstrip": false,
|
| 36 |
+
"normalized": false,
|
| 37 |
+
"rstrip": false,
|
| 38 |
+
"single_word": false
|
| 39 |
+
},
|
| 40 |
+
"unk_token": {
|
| 41 |
+
"content": "<unk>",
|
| 42 |
+
"lstrip": false,
|
| 43 |
+
"normalized": false,
|
| 44 |
+
"rstrip": false,
|
| 45 |
+
"single_word": false
|
| 46 |
+
}
|
| 47 |
+
}
|
tokenization_internlm2.py
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (c) The InternLM team and The HuggingFace Inc. team. All rights reserved.
|
| 2 |
+
#
|
| 3 |
+
# This code is based on transformers/src/transformers/models/llama/tokenization_llama.py
|
| 4 |
+
#
|
| 5 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
# you may not use this file except in compliance with the License.
|
| 7 |
+
# You may obtain a copy of the License at
|
| 8 |
+
#
|
| 9 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
#
|
| 11 |
+
# Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
# See the License for the specific language governing permissions and
|
| 15 |
+
# limitations under the License.
|
| 16 |
+
|
| 17 |
+
"""Tokenization classes for InternLM."""
|
| 18 |
+
import os
|
| 19 |
+
from shutil import copyfile
|
| 20 |
+
from typing import Any, Dict, List, Optional, Tuple
|
| 21 |
+
|
| 22 |
+
import sentencepiece as spm
|
| 23 |
+
from transformers.tokenization_utils import PreTrainedTokenizer
|
| 24 |
+
from transformers.utils import logging
|
| 25 |
+
|
| 26 |
+
logger = logging.get_logger(__name__)
|
| 27 |
+
|
| 28 |
+
VOCAB_FILES_NAMES = {'vocab_file': './tokenizer.model'}
|
| 29 |
+
|
| 30 |
+
PRETRAINED_VOCAB_FILES_MAP = {}
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
# Modified from transformers.model.llama.tokenization_llama.LlamaTokenizer
|
| 34 |
+
class InternLM2Tokenizer(PreTrainedTokenizer):
|
| 35 |
+
"""
|
| 36 |
+
Construct a InternLM2 tokenizer. Based on byte-level Byte-Pair-Encoding.
|
| 37 |
+
|
| 38 |
+
Args:
|
| 39 |
+
vocab_file (`str`):
|
| 40 |
+
Path to the vocabulary file.
|
| 41 |
+
"""
|
| 42 |
+
|
| 43 |
+
vocab_files_names = VOCAB_FILES_NAMES
|
| 44 |
+
pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP
|
| 45 |
+
model_input_names = ['input_ids', 'attention_mask']
|
| 46 |
+
_auto_class = 'AutoTokenizer'
|
| 47 |
+
|
| 48 |
+
def __init__(
|
| 49 |
+
self,
|
| 50 |
+
vocab_file,
|
| 51 |
+
unk_token='<unk>',
|
| 52 |
+
bos_token='<s>',
|
| 53 |
+
eos_token='</s>',
|
| 54 |
+
pad_token='</s>',
|
| 55 |
+
sp_model_kwargs: Optional[Dict[str, Any]] = None,
|
| 56 |
+
add_bos_token=True,
|
| 57 |
+
add_eos_token=False,
|
| 58 |
+
decode_with_prefix_space=False,
|
| 59 |
+
clean_up_tokenization_spaces=False,
|
| 60 |
+
**kwargs,
|
| 61 |
+
):
|
| 62 |
+
self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
|
| 63 |
+
self.vocab_file = vocab_file
|
| 64 |
+
self.add_bos_token = add_bos_token
|
| 65 |
+
self.add_eos_token = add_eos_token
|
| 66 |
+
self.decode_with_prefix_space = decode_with_prefix_space
|
| 67 |
+
self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
|
| 68 |
+
self.sp_model.Load(vocab_file)
|
| 69 |
+
self._no_prefix_space_tokens = None
|
| 70 |
+
super().__init__(
|
| 71 |
+
bos_token=bos_token,
|
| 72 |
+
eos_token=eos_token,
|
| 73 |
+
unk_token=unk_token,
|
| 74 |
+
pad_token=pad_token,
|
| 75 |
+
clean_up_tokenization_spaces=clean_up_tokenization_spaces,
|
| 76 |
+
**kwargs,
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
@property
|
| 80 |
+
def no_prefix_space_tokens(self):
|
| 81 |
+
if self._no_prefix_space_tokens is None:
|
| 82 |
+
vocab = self.convert_ids_to_tokens(list(range(self.vocab_size)))
|
| 83 |
+
self._no_prefix_space_tokens = {i for i, tok in enumerate(vocab) if not tok.startswith('▁')}
|
| 84 |
+
return self._no_prefix_space_tokens
|
| 85 |
+
|
| 86 |
+
@property
|
| 87 |
+
def vocab_size(self):
|
| 88 |
+
"""Returns vocab size"""
|
| 89 |
+
return self.sp_model.get_piece_size()
|
| 90 |
+
|
| 91 |
+
@property
|
| 92 |
+
def bos_token_id(self) -> Optional[int]:
|
| 93 |
+
return self.sp_model.bos_id()
|
| 94 |
+
|
| 95 |
+
@property
|
| 96 |
+
def eos_token_id(self) -> Optional[int]:
|
| 97 |
+
return self.sp_model.eos_id()
|
| 98 |
+
|
| 99 |
+
def get_vocab(self):
|
| 100 |
+
"""Returns vocab as a dict"""
|
| 101 |
+
vocab = {self.convert_ids_to_tokens(i): i for i in range(self.vocab_size)}
|
| 102 |
+
vocab.update(self.added_tokens_encoder)
|
| 103 |
+
return vocab
|
| 104 |
+
|
| 105 |
+
def _tokenize(self, text):
|
| 106 |
+
"""Returns a tokenized string."""
|
| 107 |
+
return self.sp_model.encode(text, out_type=str)
|
| 108 |
+
|
| 109 |
+
def _convert_token_to_id(self, token):
|
| 110 |
+
"""Converts a token (str) in an id using the vocab."""
|
| 111 |
+
return self.sp_model.piece_to_id(token)
|
| 112 |
+
|
| 113 |
+
def _convert_id_to_token(self, index):
|
| 114 |
+
"""Converts an index (integer) in a token (str) using the vocab."""
|
| 115 |
+
token = self.sp_model.IdToPiece(index)
|
| 116 |
+
return token
|
| 117 |
+
|
| 118 |
+
def _maybe_add_prefix_space(self, tokens, decoded):
|
| 119 |
+
if tokens and tokens[0] not in self.no_prefix_space_tokens:
|
| 120 |
+
return ' ' + decoded
|
| 121 |
+
else:
|
| 122 |
+
return decoded
|
| 123 |
+
|
| 124 |
+
def convert_tokens_to_string(self, tokens):
|
| 125 |
+
"""Converts a sequence of tokens (string) in a single string."""
|
| 126 |
+
current_sub_tokens = []
|
| 127 |
+
out_string = ''
|
| 128 |
+
prev_is_special = False
|
| 129 |
+
for token in tokens:
|
| 130 |
+
# make sure that special tokens are not decoded using sentencepiece model
|
| 131 |
+
if token in self.all_special_tokens:
|
| 132 |
+
if not prev_is_special:
|
| 133 |
+
out_string += ' '
|
| 134 |
+
out_string += self.sp_model.decode(current_sub_tokens) + token
|
| 135 |
+
prev_is_special = True
|
| 136 |
+
current_sub_tokens = []
|
| 137 |
+
else:
|
| 138 |
+
current_sub_tokens.append(token)
|
| 139 |
+
prev_is_special = False
|
| 140 |
+
out_string += self.sp_model.decode(current_sub_tokens)
|
| 141 |
+
out_string = self.clean_up_tokenization(out_string)
|
| 142 |
+
out_string = self._maybe_add_prefix_space(tokens=tokens, decoded=out_string)
|
| 143 |
+
return out_string[1:]
|
| 144 |
+
|
| 145 |
+
def save_vocabulary(self, save_directory, filename_prefix: Optional[str] = None) -> Tuple[str]:
|
| 146 |
+
"""
|
| 147 |
+
Save the vocabulary and special tokens file to a directory.
|
| 148 |
+
|
| 149 |
+
Args:
|
| 150 |
+
save_directory (`str`):
|
| 151 |
+
The directory in which to save the vocabulary.
|
| 152 |
+
|
| 153 |
+
Returns:
|
| 154 |
+
`Tuple(str)`: Paths to the files saved.
|
| 155 |
+
"""
|
| 156 |
+
if not os.path.isdir(save_directory):
|
| 157 |
+
logger.error(f'Vocabulary path ({save_directory}) should be a directory')
|
| 158 |
+
return
|
| 159 |
+
out_vocab_file = os.path.join(
|
| 160 |
+
save_directory, (filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES['vocab_file']
|
| 161 |
+
)
|
| 162 |
+
|
| 163 |
+
if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file) and os.path.isfile(self.vocab_file):
|
| 164 |
+
copyfile(self.vocab_file, out_vocab_file)
|
| 165 |
+
elif not os.path.isfile(self.vocab_file):
|
| 166 |
+
with open(out_vocab_file, 'wb') as fi:
|
| 167 |
+
content_spiece_model = self.sp_model.serialized_model_proto()
|
| 168 |
+
fi.write(content_spiece_model)
|
| 169 |
+
|
| 170 |
+
return (out_vocab_file,)
|
| 171 |
+
|
| 172 |
+
def build_inputs_with_special_tokens(self, token_ids_0, token_ids_1=None):
|
| 173 |
+
if self.add_bos_token:
|
| 174 |
+
bos_token_ids = [self.bos_token_id]
|
| 175 |
+
else:
|
| 176 |
+
bos_token_ids = []
|
| 177 |
+
|
| 178 |
+
output = bos_token_ids + token_ids_0
|
| 179 |
+
|
| 180 |
+
if token_ids_1 is not None:
|
| 181 |
+
output = output + token_ids_1
|
| 182 |
+
|
| 183 |
+
if self.add_eos_token:
|
| 184 |
+
output = output + [self.eos_token_id]
|
| 185 |
+
|
| 186 |
+
return output
|
| 187 |
+
|
| 188 |
+
def get_special_tokens_mask(
|
| 189 |
+
self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None, already_has_special_tokens: bool = False
|
| 190 |
+
) -> List[int]:
|
| 191 |
+
"""
|
| 192 |
+
Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
|
| 193 |
+
special tokens using the tokenizer `prepare_for_model` method.
|
| 194 |
+
|
| 195 |
+
Args:
|
| 196 |
+
token_ids_0 (`List[int]`):
|
| 197 |
+
List of IDs.
|
| 198 |
+
token_ids_1 (`List[int]`, *optional*):
|
| 199 |
+
Optional second list of IDs for sequence pairs.
|
| 200 |
+
already_has_special_tokens (`bool`, *optional*, defaults to `False`):
|
| 201 |
+
Whether or not the token list is already formatted with special tokens for the model.
|
| 202 |
+
|
| 203 |
+
Returns:
|
| 204 |
+
`List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
|
| 205 |
+
"""
|
| 206 |
+
if already_has_special_tokens:
|
| 207 |
+
return super().get_special_tokens_mask(
|
| 208 |
+
token_ids_0=token_ids_0, token_ids_1=token_ids_1, already_has_special_tokens=True
|
| 209 |
+
)
|
| 210 |
+
|
| 211 |
+
if token_ids_1 is None:
|
| 212 |
+
return [1] + ([0] * len(token_ids_0)) + [1]
|
| 213 |
+
return [1] + ([0] * len(token_ids_0)) + [1, 1] + ([0] * len(token_ids_1)) + [1]
|
| 214 |
+
|
| 215 |
+
def create_token_type_ids_from_sequences(
|
| 216 |
+
self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None
|
| 217 |
+
) -> List[int]:
|
| 218 |
+
"""
|
| 219 |
+
Create a mask from the two sequences passed to be used in a sequence-pair classification task. T5 does not make
|
| 220 |
+
use of token type ids, therefore a list of zeros is returned.
|
| 221 |
+
|
| 222 |
+
Args:
|
| 223 |
+
token_ids_0 (`List[int]`):
|
| 224 |
+
List of IDs.
|
| 225 |
+
token_ids_1 (`List[int]`, *optional*):
|
| 226 |
+
Optional second list of IDs for sequence pairs.
|
| 227 |
+
|
| 228 |
+
Returns:
|
| 229 |
+
`List[int]`: List of zeros.
|
| 230 |
+
"""
|
| 231 |
+
eos = [self.eos_token_id]
|
| 232 |
+
|
| 233 |
+
if token_ids_1 is None:
|
| 234 |
+
return len(token_ids_0 + eos) * [0]
|
| 235 |
+
return len(token_ids_0 + eos + token_ids_1 + eos) * [0]
|
tokenizer.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f868398fc4e05ee1e8aeba95ddf18ddcc45b8bce55d5093bead5bbf80429b48b
|
| 3 |
+
size 1477754
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<unk>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<s>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "</s>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"92538": {
|
| 28 |
+
"content": "<|plugin|>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"92539": {
|
| 36 |
+
"content": "<|interpreter|>",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
},
|
| 43 |
+
"92540": {
|
| 44 |
+
"content": "<|action_end|>",
|
| 45 |
+
"lstrip": false,
|
| 46 |
+
"normalized": false,
|
| 47 |
+
"rstrip": false,
|
| 48 |
+
"single_word": false,
|
| 49 |
+
"special": true
|
| 50 |
+
},
|
| 51 |
+
"92541": {
|
| 52 |
+
"content": "<|action_start|>",
|
| 53 |
+
"lstrip": false,
|
| 54 |
+
"normalized": false,
|
| 55 |
+
"rstrip": false,
|
| 56 |
+
"single_word": false,
|
| 57 |
+
"special": true
|
| 58 |
+
},
|
| 59 |
+
"92542": {
|
| 60 |
+
"content": "<|im_end|>",
|
| 61 |
+
"lstrip": false,
|
| 62 |
+
"normalized": false,
|
| 63 |
+
"rstrip": false,
|
| 64 |
+
"single_word": false,
|
| 65 |
+
"special": true
|
| 66 |
+
},
|
| 67 |
+
"92543": {
|
| 68 |
+
"content": "<|im_start|>",
|
| 69 |
+
"lstrip": false,
|
| 70 |
+
"normalized": false,
|
| 71 |
+
"rstrip": false,
|
| 72 |
+
"single_word": false,
|
| 73 |
+
"special": true
|
| 74 |
+
},
|
| 75 |
+
"92544": {
|
| 76 |
+
"content": "<img>",
|
| 77 |
+
"lstrip": false,
|
| 78 |
+
"normalized": false,
|
| 79 |
+
"rstrip": false,
|
| 80 |
+
"single_word": false,
|
| 81 |
+
"special": true
|
| 82 |
+
},
|
| 83 |
+
"92545": {
|
| 84 |
+
"content": "</img>",
|
| 85 |
+
"lstrip": false,
|
| 86 |
+
"normalized": false,
|
| 87 |
+
"rstrip": false,
|
| 88 |
+
"single_word": false,
|
| 89 |
+
"special": true
|
| 90 |
+
},
|
| 91 |
+
"92546": {
|
| 92 |
+
"content": "<IMG_CONTEXT>",
|
| 93 |
+
"lstrip": false,
|
| 94 |
+
"normalized": false,
|
| 95 |
+
"rstrip": false,
|
| 96 |
+
"single_word": false,
|
| 97 |
+
"special": true
|
| 98 |
+
},
|
| 99 |
+
"92547": {
|
| 100 |
+
"content": "<quad>",
|
| 101 |
+
"lstrip": false,
|
| 102 |
+
"normalized": false,
|
| 103 |
+
"rstrip": false,
|
| 104 |
+
"single_word": false,
|
| 105 |
+
"special": true
|
| 106 |
+
},
|
| 107 |
+
"92548": {
|
| 108 |
+
"content": "</quad>",
|
| 109 |
+
"lstrip": false,
|
| 110 |
+
"normalized": false,
|
| 111 |
+
"rstrip": false,
|
| 112 |
+
"single_word": false,
|
| 113 |
+
"special": true
|
| 114 |
+
},
|
| 115 |
+
"92549": {
|
| 116 |
+
"content": "<ref>",
|
| 117 |
+
"lstrip": false,
|
| 118 |
+
"normalized": false,
|
| 119 |
+
"rstrip": false,
|
| 120 |
+
"single_word": false,
|
| 121 |
+
"special": true
|
| 122 |
+
},
|
| 123 |
+
"92550": {
|
| 124 |
+
"content": "</ref>",
|
| 125 |
+
"lstrip": false,
|
| 126 |
+
"normalized": false,
|
| 127 |
+
"rstrip": false,
|
| 128 |
+
"single_word": false,
|
| 129 |
+
"special": true
|
| 130 |
+
},
|
| 131 |
+
"92551": {
|
| 132 |
+
"content": "<box>",
|
| 133 |
+
"lstrip": false,
|
| 134 |
+
"normalized": false,
|
| 135 |
+
"rstrip": false,
|
| 136 |
+
"single_word": false,
|
| 137 |
+
"special": true
|
| 138 |
+
},
|
| 139 |
+
"92552": {
|
| 140 |
+
"content": "</box>",
|
| 141 |
+
"lstrip": false,
|
| 142 |
+
"normalized": false,
|
| 143 |
+
"rstrip": false,
|
| 144 |
+
"single_word": false,
|
| 145 |
+
"special": true
|
| 146 |
+
}
|
| 147 |
+
},
|
| 148 |
+
"additional_special_tokens": [
|
| 149 |
+
"<|im_start|>",
|
| 150 |
+
"<|im_end|>",
|
| 151 |
+
"<|action_start|>",
|
| 152 |
+
"<|action_end|>",
|
| 153 |
+
"<|interpreter|>",
|
| 154 |
+
"<|plugin|>",
|
| 155 |
+
"<img>",
|
| 156 |
+
"</img>",
|
| 157 |
+
"<IMG_CONTEXT>",
|
| 158 |
+
"<quad>",
|
| 159 |
+
"</quad>",
|
| 160 |
+
"<ref>",
|
| 161 |
+
"</ref>",
|
| 162 |
+
"<box>",
|
| 163 |
+
"</box>"
|
| 164 |
+
],
|
| 165 |
+
"auto_map": {
|
| 166 |
+
"AutoTokenizer": [
|
| 167 |
+
"tokenization_internlm2.InternLM2Tokenizer",
|
| 168 |
+
null
|
| 169 |
+
]
|
| 170 |
+
},
|
| 171 |
+
"bos_token": "<s>",
|
| 172 |
+
"chat_template": "{{ bos_token }}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
| 173 |
+
"clean_up_tokenization_spaces": false,
|
| 174 |
+
"eos_token": "</s>",
|
| 175 |
+
"extra_special_tokens": {},
|
| 176 |
+
"model_max_length": 4096,
|
| 177 |
+
"pad_token": "</s>",
|
| 178 |
+
"tokenizer_class": "InternLM2Tokenizer",
|
| 179 |
+
"unk_token": "<unk>"
|
| 180 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0ffaf95c99f68af17d1759f576d1fba7fac5941e396a7dc61e413df63b7bbc23
|
| 3 |
+
size 7160
|
training_log.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e684c476883d72bf84d2b198c64543136dbf01c05921867f6235d73089a6321
|
| 3 |
+
size 118685696
|