kopcion commited on
Commit
f719afe
·
verified ·
1 Parent(s): fc0d118

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -37,3 +37,4 @@ lfm2.5-1.2B-instruct/original/lfm2_5_1_2b_fp16.pte filter=lfs diff=lfs merge=lfs
37
  lfm2.5-1.2B-instruct/quantized/lfm2_5_1_2b_8da4w.pte filter=lfs diff=lfs merge=lfs -text
38
  lfm2.5-350M/xnnpack/lfm2_5_350m_xnnpack_8w4da.pte filter=lfs diff=lfs merge=lfs -text
39
  lfm2.5-350M/xnnpack/lfm2_5_350m_xnnpack_fp16.pte filter=lfs diff=lfs merge=lfs -text
 
 
37
  lfm2.5-1.2B-instruct/quantized/lfm2_5_1_2b_8da4w.pte filter=lfs diff=lfs merge=lfs -text
38
  lfm2.5-350M/xnnpack/lfm2_5_350m_xnnpack_8w4da.pte filter=lfs diff=lfs merge=lfs -text
39
  lfm2.5-350M/xnnpack/lfm2_5_350m_xnnpack_fp16.pte filter=lfs diff=lfs merge=lfs -text
40
+ lfm2.5-VL-1.6B/quantized/lfm2_5_vl_1_6b_8da4w_xnnpack.pte filter=lfs diff=lfs merge=lfs -text
lfm2.5-VL-1.6B/.gitattributes ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz 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
+ quantized/lfm2_5_vl_1_6b_8da4w_xnnpack.pte filter=lfs diff=lfs merge=lfs -text
lfm2.5-VL-1.6B/README.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: lfm1.0
4
+ license_link: https://huggingface.co/LiquidAI/LFM2.5-VL-1.6B/blob/main/LICENSE
5
+ pipeline_tag: image-text-to-text
6
+ tags:
7
+ - liquid
8
+ - lfm2
9
+ - lfm2-vl
10
+ - edge
11
+ - lfm2.5-vl
12
+ - lfm2.5
13
+ ---
14
+
15
+ # Introduction
16
+
17
+ This repository hosts the **LFM2.5-VL-1.6B** vision-language model for the [React Native ExecuTorch](https://www.npmjs.com/package/react-native-executorch) library. It includes a **quantized** version in `.pte` format, ready for use in the **ExecuTorch** runtime.
18
+
19
+ If you'd like to run these models in your own ExecuTorch runtime, refer to the [official documentation](https://pytorch.org/executorch/stable/index.html) for setup instructions.
20
+
21
+ ## Compatibility
22
+
23
+ If you intend to use this model outside of React Native ExecuTorch, make sure your runtime is compatible with the **ExecuTorch** version used to export the `.pte` files. For more details, see the compatibility note in the [ExecuTorch GitHub repository](https://github.com/pytorch/executorch/blob/11d1742fdeddcf05bc30a6cfac321d2a2e3b6768/runtime/COMPATIBILITY.md?plain=1#L4). If you work with React Native ExecuTorch, the constants from the library will guarantee compatibility with the runtime used behind the scenes.
24
+
25
+ ## Repository Structure
26
+
27
+ The repository is organized as follows:
28
+ - The `.pte` file should be passed to the `modelSource` parameter.
29
+ - The tokenizer files are available in the repo root: `tokenizer.json` and `tokenizer_config.json` should be passed to `tokenizerSource` and `tokenizerConfigSource` respectively.
lfm2.5-VL-1.6B/quantized/config.json ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Lfm2VlForConditionalGeneration"
4
+ ],
5
+ "do_image_splitting": true,
6
+ "downsample_factor": 2,
7
+ "dtype": "bfloat16",
8
+ "encoder_patch_size": 16,
9
+ "image_token_id": 396,
10
+ "max_image_tokens": 256,
11
+ "max_pixels_tolerance": 2.0,
12
+ "max_tiles": 10,
13
+ "min_image_tokens": 64,
14
+ "min_tiles": 2,
15
+ "model_type": "lfm2_vl",
16
+ "projector_bias": true,
17
+ "projector_hidden_act": "gelu",
18
+ "projector_hidden_size": 2048,
19
+ "projector_use_layernorm": false,
20
+ "text_config": {
21
+ "_name_or_path": "LiquidAI/LFM2-1.2B",
22
+ "architectures": [
23
+ "Lfm2ForCausalLM"
24
+ ],
25
+ "block_auto_adjust_ff_dim": true,
26
+ "block_dim": 2048,
27
+ "block_ff_dim": 12288,
28
+ "block_ffn_dim_multiplier": 1.0,
29
+ "block_mlp_init_scale": 1.0,
30
+ "block_multiple_of": 256,
31
+ "block_norm_eps": 1e-05,
32
+ "block_out_init_scale": 1.0,
33
+ "block_use_swiglu": true,
34
+ "block_use_xavier_init": true,
35
+ "conv_L_cache": 3,
36
+ "conv_bias": false,
37
+ "conv_dim": 2048,
38
+ "conv_dim_out": 2048,
39
+ "conv_use_xavier_init": true,
40
+ "dtype": "bfloat16",
41
+ "eos_token_id": 7,
42
+ "hidden_size": 2048,
43
+ "initializer_range": 0.02,
44
+ "intermediate_size": 12288,
45
+ "layer_types": [
46
+ "conv",
47
+ "conv",
48
+ "full_attention",
49
+ "conv",
50
+ "conv",
51
+ "full_attention",
52
+ "conv",
53
+ "conv",
54
+ "full_attention",
55
+ "conv",
56
+ "full_attention",
57
+ "conv",
58
+ "full_attention",
59
+ "conv",
60
+ "full_attention",
61
+ "conv"
62
+ ],
63
+ "max_position_embeddings": 128000,
64
+ "model_type": "lfm2",
65
+ "norm_eps": 1e-05,
66
+ "num_attention_heads": 32,
67
+ "num_heads": 32,
68
+ "num_hidden_layers": 16,
69
+ "num_key_value_heads": 8,
70
+ "rope_parameters": {
71
+ "rope_theta": 1000000.0,
72
+ "rope_type": "default"
73
+ },
74
+ "use_cache": true,
75
+ "use_pos_enc": true,
76
+ "vocab_size": 65536
77
+ },
78
+ "tile_size": 512,
79
+ "transformers_version": "5.0.0.dev0",
80
+ "use_image_special_tokens": true,
81
+ "use_thumbnail": true,
82
+ "vision_config": {
83
+ "attention_dropout": 0.0,
84
+ "dtype": "bfloat16",
85
+ "hidden_act": "gelu_pytorch_tanh",
86
+ "hidden_size": 1152,
87
+ "intermediate_size": 4304,
88
+ "layer_norm_eps": 1e-06,
89
+ "model_type": "siglip2_vision_model",
90
+ "num_attention_heads": 16,
91
+ "num_channels": 3,
92
+ "num_hidden_layers": 27,
93
+ "num_patches": 256,
94
+ "patch_size": 16,
95
+ "vision_use_head": false
96
+ }
97
+ }
lfm2.5-VL-1.6B/quantized/lfm2_5_vl_1_6b_8da4w_xnnpack.pte ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f942c856acfe1a4d0b5f8d30bd752b5552bcf20bc6dfa6f3253896b2456d0c4
3
+ size 2427656704
lfm2.5-VL-1.6B/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
lfm2.5-VL-1.6B/tokenizer_config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|startoftext|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|im_end|>",
6
+ "image_end_token": "<|image_end|>",
7
+ "image_start_token": "<|image_start|>",
8
+ "image_thumbnail": "<|img_thumbnail|>",
9
+ "image_token": "<image>",
10
+ "is_local": true,
11
+ "legacy": false,
12
+ "model_max_length": 1000000000000000019884624838656,
13
+ "model_specific_special_tokens": {
14
+ "image_end_token": "<|image_end|>",
15
+ "image_start_token": "<|image_start|>",
16
+ "image_thumbnail": "<|img_thumbnail|>",
17
+ "image_token": "<image>"
18
+ },
19
+ "pad_token": "<|pad|>",
20
+ "processor_class": "Lfm2VlProcessor",
21
+ "return_token_type_ids": false,
22
+ "sp_model_kwargs": {},
23
+ "spaces_between_special_tokens": false,
24
+ "tokenizer_class": "TokenizersBackend",
25
+ "use_default_system_prompt": false,
26
+ "use_fast": true,
27
+ "chat_template": "{%- set keep_past_thinking = keep_past_thinking | default(false) -%}{%- set ns = namespace(system_prompt=\"\") -%}{%- if messages[0][\"role\"] == \"system\" -%}{%- set sys_content = messages[0][\"content\"] -%}{%- if sys_content is not string -%}{%- for item in sys_content -%}{%- if item[\"type\"] == \"text\" -%}{%- set ns.system_prompt = ns.system_prompt + item[\"text\"] -%}{%- endif -%}{%- endfor -%}{%- else -%}{%- set ns.system_prompt = sys_content -%}{%- endif -%}{%- set messages = messages[1:] -%}{%- endif -%}{%- if tools -%}{%- set ns.system_prompt = ns.system_prompt + (\"\n\" if ns.system_prompt else \"\") + \"List of tools: [\" -%}{%- for tool in tools -%}{%- if tool is not string -%}{%- set tool = tool | tojson -%}{%- endif -%}{%- set ns.system_prompt = ns.system_prompt + tool -%}{%- if not loop.last -%}{%- set ns.system_prompt = ns.system_prompt + \", \" -%}{%- endif -%}{%- endfor -%}{%- set ns.system_prompt = ns.system_prompt + \"]\" -%}{%- endif -%}{%- if ns.system_prompt -%}{{- \"<|im_start|>system\n\" + ns.system_prompt + \"<|im_end|>\n\" -}}{%- endif -%}{%- set ns.last_assistant_index = -1 -%}{%- for message in messages -%}{%- if message[\"role\"] == \"assistant\" -%}{%- set ns.last_assistant_index = loop.index0 -%}{%- endif -%}{%- endfor -%}{%- for message in messages -%}{{- \"<|im_start|>\" + message[\"role\"] + \"\n\" -}}{%- if message[\"content\"] is not string -%}{%- set ns.content = \"\" -%}{%- for item in message[\"content\"] -%}{%- if item[\"type\"] == \"image\" -%}{%- set ns.content = ns.content + \"<image>\" -%}{%- elif item[\"type\"] == \"text\" -%}{%- set ns.content = ns.content + item[\"text\"] -%}{%- else -%}{%- set ns.content = ns.content + item | tojson -%}{%- endif -%}{%- endfor -%}{%- set content = ns.content -%}{%- else -%}{%- set content = message[\"content\"] -%}{%- endif -%}{%- if message[\"role\"] == \"assistant\" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}{%- if \"</think>\" in content -%}{%- set content = content.split(\"</think>\")[-1] | trim -%}{%- endif -%}{%- endif -%}{{- content + \"<|im_end|>\n\" -}}{%- endfor -%}{%- if add_generation_prompt -%}{{- \"<|im_start|>assistant\n\" -}}{%- endif -%}"
28
+ }