Upload folder using huggingface_hub
Browse files- README.md +2 -2
- config.json +0 -56
- modeling_intern_vit.py +1 -0
- modeling_internvl_chat.py +1 -0
README.md
CHANGED
@@ -65,7 +65,7 @@ For more information about the pipeline parameters, please refer to [here](https
|
|
65 |
LMDeploy's `api_server` enables models to be easily packed into services with a single command. The provided RESTful APIs are compatible with OpenAI's interfaces. Below are an example of service startup:
|
66 |
|
67 |
```shell
|
68 |
-
lmdeploy serve api_server OpenGVLab/InternVL2-26B-AWQ --server-port 23333
|
69 |
```
|
70 |
|
71 |
To use the OpenAI-style interface, you need to install OpenAI:
|
@@ -104,7 +104,7 @@ print(response)
|
|
104 |
|
105 |
## License
|
106 |
|
107 |
-
This project is released under the MIT license, while
|
108 |
|
109 |
## Citation
|
110 |
|
|
|
65 |
LMDeploy's `api_server` enables models to be easily packed into services with a single command. The provided RESTful APIs are compatible with OpenAI's interfaces. Below are an example of service startup:
|
66 |
|
67 |
```shell
|
68 |
+
lmdeploy serve api_server OpenGVLab/InternVL2-26B-AWQ --backend turbomind --server-port 23333 --model-format awq
|
69 |
```
|
70 |
|
71 |
To use the OpenAI-style interface, you need to install OpenAI:
|
|
|
104 |
|
105 |
## License
|
106 |
|
107 |
+
This project is released under the MIT license, while InternLM2 is licensed under the Apache-2.0 license.
|
108 |
|
109 |
## Citation
|
110 |
|
config.json
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
{
|
2 |
"_commit_hash": null,
|
3 |
-
"_name_or_path": "/mnt/142/InternVL2-26B",
|
4 |
"architectures": [
|
5 |
"InternVLChatModel"
|
6 |
],
|
@@ -115,91 +114,36 @@
|
|
115 |
"select_layer": -1,
|
116 |
"template": "internlm2-chat",
|
117 |
"torch_dtype": "float16",
|
118 |
-
"transformers_version": null,
|
119 |
"use_backbone_lora": 0,
|
120 |
"use_llm_lora": 0,
|
121 |
"use_thumbnail": true,
|
122 |
"vision_config": {
|
123 |
-
"_name_or_path": "",
|
124 |
-
"add_cross_attention": false,
|
125 |
"architectures": [
|
126 |
"InternVisionModel"
|
127 |
],
|
128 |
"attention_dropout": 0.0,
|
129 |
-
"bad_words_ids": null,
|
130 |
-
"begin_suppress_tokens": null,
|
131 |
-
"bos_token_id": null,
|
132 |
-
"chunk_size_feed_forward": 0,
|
133 |
-
"cross_attention_hidden_size": null,
|
134 |
-
"decoder_start_token_id": null,
|
135 |
-
"diversity_penalty": 0.0,
|
136 |
-
"do_sample": false,
|
137 |
"drop_path_rate": 0.0,
|
138 |
"dropout": 0.0,
|
139 |
-
"early_stopping": false,
|
140 |
-
"encoder_no_repeat_ngram_size": 0,
|
141 |
-
"eos_token_id": null,
|
142 |
-
"exponential_decay_length_penalty": null,
|
143 |
-
"finetuning_task": null,
|
144 |
-
"forced_bos_token_id": null,
|
145 |
-
"forced_eos_token_id": null,
|
146 |
"hidden_act": "gelu",
|
147 |
"hidden_size": 3200,
|
148 |
-
"id2label": {
|
149 |
-
"0": "LABEL_0",
|
150 |
-
"1": "LABEL_1"
|
151 |
-
},
|
152 |
"image_size": 448,
|
153 |
"initializer_factor": 0.1,
|
154 |
"initializer_range": 1e-10,
|
155 |
"intermediate_size": 12800,
|
156 |
-
"is_decoder": false,
|
157 |
-
"is_encoder_decoder": false,
|
158 |
-
"label2id": {
|
159 |
-
"LABEL_0": 0,
|
160 |
-
"LABEL_1": 1
|
161 |
-
},
|
162 |
"layer_norm_eps": 1e-06,
|
163 |
-
"length_penalty": 1.0,
|
164 |
-
"max_length": 20,
|
165 |
-
"min_length": 0,
|
166 |
"model_type": "intern_vit_6b",
|
167 |
-
"no_repeat_ngram_size": 0,
|
168 |
"norm_type": "rms_norm",
|
169 |
"num_attention_heads": 25,
|
170 |
-
"num_beam_groups": 1,
|
171 |
-
"num_beams": 1,
|
172 |
"num_channels": 3,
|
173 |
"num_hidden_layers": 45,
|
174 |
-
"num_return_sequences": 1,
|
175 |
"output_attentions": false,
|
176 |
"output_hidden_states": false,
|
177 |
-
"output_scores": false,
|
178 |
-
"pad_token_id": null,
|
179 |
"patch_size": 14,
|
180 |
-
"prefix": null,
|
181 |
-
"problem_type": null,
|
182 |
-
"pruned_heads": {},
|
183 |
"qk_normalization": true,
|
184 |
"qkv_bias": false,
|
185 |
-
"remove_invalid_values": false,
|
186 |
-
"repetition_penalty": 1.0,
|
187 |
"return_dict": true,
|
188 |
-
"return_dict_in_generate": false,
|
189 |
-
"sep_token_id": null,
|
190 |
-
"suppress_tokens": null,
|
191 |
-
"task_specific_params": null,
|
192 |
-
"temperature": 1.0,
|
193 |
-
"tf_legacy_loss": false,
|
194 |
-
"tie_encoder_decoder": false,
|
195 |
-
"tie_word_embeddings": true,
|
196 |
-
"tokenizer_class": null,
|
197 |
-
"top_k": 50,
|
198 |
-
"top_p": 1.0,
|
199 |
"torch_dtype": "bfloat16",
|
200 |
-
"torchscript": false,
|
201 |
"transformers_version": "4.40.0",
|
202 |
-
"typical_p": 1.0,
|
203 |
"use_bfloat16": true,
|
204 |
"use_flash_attn": true
|
205 |
}
|
|
|
1 |
{
|
2 |
"_commit_hash": null,
|
|
|
3 |
"architectures": [
|
4 |
"InternVLChatModel"
|
5 |
],
|
|
|
114 |
"select_layer": -1,
|
115 |
"template": "internlm2-chat",
|
116 |
"torch_dtype": "float16",
|
|
|
117 |
"use_backbone_lora": 0,
|
118 |
"use_llm_lora": 0,
|
119 |
"use_thumbnail": true,
|
120 |
"vision_config": {
|
|
|
|
|
121 |
"architectures": [
|
122 |
"InternVisionModel"
|
123 |
],
|
124 |
"attention_dropout": 0.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
"drop_path_rate": 0.0,
|
126 |
"dropout": 0.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
"hidden_act": "gelu",
|
128 |
"hidden_size": 3200,
|
|
|
|
|
|
|
|
|
129 |
"image_size": 448,
|
130 |
"initializer_factor": 0.1,
|
131 |
"initializer_range": 1e-10,
|
132 |
"intermediate_size": 12800,
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
"layer_norm_eps": 1e-06,
|
|
|
|
|
|
|
134 |
"model_type": "intern_vit_6b",
|
|
|
135 |
"norm_type": "rms_norm",
|
136 |
"num_attention_heads": 25,
|
|
|
|
|
137 |
"num_channels": 3,
|
138 |
"num_hidden_layers": 45,
|
|
|
139 |
"output_attentions": false,
|
140 |
"output_hidden_states": false,
|
|
|
|
|
141 |
"patch_size": 14,
|
|
|
|
|
|
|
142 |
"qk_normalization": true,
|
143 |
"qkv_bias": false,
|
|
|
|
|
144 |
"return_dict": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
"torch_dtype": "bfloat16",
|
|
|
146 |
"transformers_version": "4.40.0",
|
|
|
147 |
"use_bfloat16": true,
|
148 |
"use_flash_attn": true
|
149 |
}
|
modeling_intern_vit.py
CHANGED
@@ -368,6 +368,7 @@ class InternVisionEncoder(nn.Module):
|
|
368 |
|
369 |
class InternVisionModel(PreTrainedModel):
|
370 |
main_input_name = 'pixel_values'
|
|
|
371 |
config_class = InternVisionConfig
|
372 |
_no_split_modules = ['InternVisionEncoderLayer']
|
373 |
|
|
|
368 |
|
369 |
class InternVisionModel(PreTrainedModel):
|
370 |
main_input_name = 'pixel_values'
|
371 |
+
_supports_flash_attn_2 = True
|
372 |
config_class = InternVisionConfig
|
373 |
_no_split_modules = ['InternVisionEncoderLayer']
|
374 |
|
modeling_internvl_chat.py
CHANGED
@@ -35,6 +35,7 @@ def version_cmp(v1, v2, op='eq'):
|
|
35 |
class InternVLChatModel(PreTrainedModel):
|
36 |
config_class = InternVLChatConfig
|
37 |
main_input_name = 'pixel_values'
|
|
|
38 |
_no_split_modules = ['InternVisionModel', 'LlamaDecoderLayer', 'InternLM2DecoderLayer']
|
39 |
|
40 |
def __init__(self, config: InternVLChatConfig, vision_model=None, language_model=None):
|
|
|
35 |
class InternVLChatModel(PreTrainedModel):
|
36 |
config_class = InternVLChatConfig
|
37 |
main_input_name = 'pixel_values'
|
38 |
+
_supports_flash_attn_2 = True
|
39 |
_no_split_modules = ['InternVisionModel', 'LlamaDecoderLayer', 'InternLM2DecoderLayer']
|
40 |
|
41 |
def __init__(self, config: InternVLChatConfig, vision_model=None, language_model=None):
|