liuzhaochen02 commited on
Commit
28487fa
1 Parent(s): 319a0a5

initial commit

Browse files
README.md CHANGED
@@ -1,3 +1,19 @@
1
  ---
2
  license: apache-2.0
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ tags:
4
+ - MobileVLM
5
  ---
6
+ ## Model Summery
7
+ MobileVLM is a competent multimodal vision language model (MMVLM) targeted to run on mobile devices. It is an amalgamation of a myriad of architectural designs and techniques that are mobile-oriented, which comprises a set of language models at the scale of 1.4B and 2.7B parameters, trained from scratch, a multimodal vision model that is pre-trained in the CLIP fashion, cross-modality interaction via an efficient projector. We evaluate MobileVLM on several typical VLM benchmarks. Our models demonstrate on par performance compared with a few much larger models. More importantly, we measure the inference speed on both a Qualcomm Snapdragon 888 CPU and an NVIDIA Jeston Orin GPU, and we obtain state-of-the-art performance of 21.5 tokens and 65.3 tokens per second, respectively.
8
+
9
+ The MobileVLM-3B was built on our [MobileLLaMA-2.7B-Chat](https://huggingface.co/mtgv/MobileLLaMA-2.7B-Chat) to facilitate the off-the-shelf deployment.
10
+
11
+ ## Model Sources
12
+ - Repository: https://github.com/Meituan-AutoML/MobileVLM
13
+ - Paper: https://arxiv.org/abs/2312.16886
14
+
15
+ ## How to Get Started with the Model
16
+ Inference examples can be found at [Github](https://github.com/Meituan-AutoML/MobileVLM).
17
+
18
+ ## Training Details
19
+ Please refer to our paper: [MobileVLM: A Fast, Strong and Open Vision Language Assistant for Mobile Devices](https://arxiv.org/pdf/2312.16886.pdf)
config.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_mlp_class": "LLaMAMLP",
3
+ "_name_or_path": "mtgv/MobileVLM-3B",
4
+ "_norm_class": "RMSNorm",
5
+ "architectures": [
6
+ "MobileLlamaForCausalLM"
7
+ ],
8
+ "bias": false,
9
+ "block_size": 2048,
10
+ "bos_token_id": 1,
11
+ "eos_token_id": 2,
12
+ "freeze_mm_mlp_adapter": false,
13
+ "gelu_approximate": "none",
14
+ "hidden_act": "silu",
15
+ "hidden_size": 2560,
16
+ "image_aspect_ratio": "pad",
17
+ "image_grid_pinpoints": null,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 6912,
20
+ "lm_head_bias": false,
21
+ "max_position_embeddings": 2048,
22
+ "mm_hidden_size": 1024,
23
+ "mm_projector_type": "ldpnet",
24
+ "mm_use_im_patch_token": false,
25
+ "mm_use_im_start_end": false,
26
+ "mm_vision_select_feature": "patch",
27
+ "mm_vision_select_layer": -2,
28
+ "mm_vision_tower": "openai/clip-vit-large-patch14-336",
29
+ "model_type": "mobilevlm",
30
+ "n_embd": 2560,
31
+ "n_head": 16,
32
+ "n_layer": 32,
33
+ "n_query_groups": 16,
34
+ "name": "huggy_llama_3b",
35
+ "norm_eps": 1e-06,
36
+ "num_attention_heads": 32,
37
+ "num_hidden_layers": 32,
38
+ "num_key_value_heads": 32,
39
+ "pad_token_id": 0,
40
+ "padded_vocab_size": 32000,
41
+ "padding_multiple": 64,
42
+ "parallel_residual": false,
43
+ "pretraining_tp": 1,
44
+ "rms_norm_eps": 1e-06,
45
+ "rope_base": 10000,
46
+ "rope_condense_ratio": 1,
47
+ "rope_scaling": null,
48
+ "rope_theta": 10000.0,
49
+ "rotary_percentage": 1.0,
50
+ "shared_attention_norm": false,
51
+ "tie_word_embeddings": false,
52
+ "torch_dtype": "bfloat16",
53
+ "transformers_version": "4.33.1",
54
+ "tune_mm_mlp_adapter": false,
55
+ "use_cache": true,
56
+ "use_mm_proj": true,
57
+ "vision_tower_type": "clip",
58
+ "vocab_size": 32000
59
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "pad_token_id": 0,
6
+ "transformers_version": "4.33.1"
7
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:379871bccce727876c04658ffa011ad422389473bb2d17b3242af0d6bacd5d17
3
+ size 6068212069
special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": "<unk>",
17
+ "unk_token": {
18
+ "content": "<unk>",
19
+ "lstrip": false,
20
+ "normalized": true,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ }
24
+ }
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
tokenizer_config.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "bos_token": {
5
+ "__type": "AddedToken",
6
+ "content": "<s>",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "clean_up_tokenization_spaces": false,
13
+ "eos_token": {
14
+ "__type": "AddedToken",
15
+ "content": "</s>",
16
+ "lstrip": false,
17
+ "normalized": true,
18
+ "rstrip": false,
19
+ "single_word": false
20
+ },
21
+ "legacy": true,
22
+ "model_max_length": 2048,
23
+ "pad_token": null,
24
+ "padding_side": "right",
25
+ "sp_model_kwargs": {},
26
+ "spaces_between_special_tokens": false,
27
+ "tokenizer_class": "LlamaTokenizer",
28
+ "unk_token": {
29
+ "__type": "AddedToken",
30
+ "content": "<unk>",
31
+ "lstrip": false,
32
+ "normalized": true,
33
+ "rstrip": false,
34
+ "single_word": false
35
+ },
36
+ "use_default_system_prompt": true
37
+ }