Upload folder using huggingface_hub
Browse files- README.md +157 -0
- added_tokens.json +22 -0
- config.json +305 -0
- configuration_intern_vit.py +120 -0
- configuration_internvl_chat.py +98 -0
- configuration_phi3.py +211 -0
- generation_config.json +9 -0
- openvino_config.json +28 -0
- openvino_detokenizer.bin +3 -0
- openvino_detokenizer.xml +353 -0
- openvino_language_model.bin +3 -0
- openvino_language_model.xml +0 -0
- openvino_text_embeddings_model.bin +3 -0
- openvino_text_embeddings_model.xml +177 -0
- openvino_tokenizer.bin +3 -0
- openvino_tokenizer.xml +823 -0
- openvino_vision_embeddings_model.bin +3 -0
- openvino_vision_embeddings_model.xml +0 -0
- preprocessor_config.json +27 -0
- special_tokens_map.json +41 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +215 -0
README.md
ADDED
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
language:
|
4 |
+
- multilingual
|
5 |
+
pipeline_tag: image-text-to-text
|
6 |
+
tags:
|
7 |
+
- nlp
|
8 |
+
- vision
|
9 |
+
- internvl
|
10 |
+
base_model:
|
11 |
+
- OpenGVLab/InternVL2-4B
|
12 |
+
base_model_relation: quantized
|
13 |
+
---
|
14 |
+
|
15 |
+
# InternVL2-4B-int4-ov
|
16 |
+
|
17 |
+
* Model creator: [OpenGVLab](https://huggingface.co/OpenGVLab)
|
18 |
+
* Original model: [InternVL2-4B](https://huggingface.co/OpenGVLab/InternVL2-4B)
|
19 |
+
|
20 |
+
## Description
|
21 |
+
|
22 |
+
This is [OpenGVLab/InternVL2-4B](https://huggingface.co/OpenGVLab/InternVL2-4B) model converted to the [OpenVINO™ IR](https://docs.openvino.ai/2025/documentation/openvino-ir-format.html) (Intermediate Representation) format with weights compressed to INT4 using Activation Aware Quantization (AWQ) by [NNCF](https://github.com/openvinotoolkit/nncf).
|
23 |
+
|
24 |
+
|
25 |
+
## Quantization Parameters
|
26 |
+
|
27 |
+
Weight compression was performed using `nncf.compress_weights` with the following parameters:
|
28 |
+
|
29 |
+
* mode: **INT4_ASYM**
|
30 |
+
* ratio: **1.0**
|
31 |
+
* group_size: **128**
|
32 |
+
* awq: **True**
|
33 |
+
* dataset: **[contextual](https://huggingface.co/datasets/ucla-contextual/contextual_test)**
|
34 |
+
* num_samples: **32**
|
35 |
+
|
36 |
+
|
37 |
+
## Compatibility
|
38 |
+
|
39 |
+
The provided OpenVINO™ IR model is compatible with:
|
40 |
+
|
41 |
+
* OpenVINO version 2025.2.0 and higher
|
42 |
+
* Optimum Intel 1.26.0 and higher
|
43 |
+
|
44 |
+
## Running Model Inference with [Optimum Intel](https://huggingface.co/docs/optimum/intel/index)
|
45 |
+
|
46 |
+
1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
|
47 |
+
|
48 |
+
```
|
49 |
+
pip install --pre -U --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release openvino_tokenizers openvino
|
50 |
+
|
51 |
+
pip install git+https://github.com/huggingface/optimum-intel.git
|
52 |
+
```
|
53 |
+
|
54 |
+
2. Run model inference
|
55 |
+
|
56 |
+
```
|
57 |
+
from PIL import Image
|
58 |
+
import requests
|
59 |
+
from optimum.intel.openvino import OVModelForVisualCausalLM
|
60 |
+
from transformers import AutoTokenizer, TextStreamer
|
61 |
+
|
62 |
+
model_id = "OpenVINO/InternVL2-4B-int4-ov"
|
63 |
+
|
64 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
65 |
+
|
66 |
+
ov_model = OVModelForVisualCausalLM.from_pretrained(model_id, trust_remote_code=True)
|
67 |
+
prompt = "What is unusual on this picture?"
|
68 |
+
|
69 |
+
url = "https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/d5fbbd1a-d484-415c-88cb-9986625b7b11"
|
70 |
+
image = Image.open(requests.get(url, stream=True).raw)
|
71 |
+
|
72 |
+
inputs = ov_model.preprocess_inputs(text=prompt, image=image, tokenizer=tokenizer, config=ov_model.config)
|
73 |
+
|
74 |
+
generation_args = {
|
75 |
+
"max_new_tokens": 100,
|
76 |
+
"streamer": TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
|
77 |
+
}
|
78 |
+
|
79 |
+
generate_ids = ov_model.generate(**inputs, **generation_args)
|
80 |
+
|
81 |
+
generate_ids = generate_ids[:, inputs['input_ids'].shape[1]:]
|
82 |
+
response = tokenizer.batch_decode(generate_ids, skip_special_tokens=True)[0]
|
83 |
+
|
84 |
+
```
|
85 |
+
|
86 |
+
## Running Model Inference with [OpenVINO GenAI](https://github.com/openvinotoolkit/openvino.genai)
|
87 |
+
|
88 |
+
1. Install packages required for using OpenVINO GenAI.
|
89 |
+
```
|
90 |
+
pip install --pre -U --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release openvino openvino-tokenizers openvino-genai
|
91 |
+
|
92 |
+
pip install huggingface_hub
|
93 |
+
```
|
94 |
+
|
95 |
+
2. Download model from HuggingFace Hub
|
96 |
+
|
97 |
+
```
|
98 |
+
import huggingface_hub as hf_hub
|
99 |
+
|
100 |
+
model_id = "OpenVINO/InternVL2-4B-int4-ov"
|
101 |
+
model_path = "InternVL2-4B-int4-ov"
|
102 |
+
|
103 |
+
hf_hub.snapshot_download(model_id, local_dir=model_path)
|
104 |
+
|
105 |
+
```
|
106 |
+
|
107 |
+
1. Run model inference:
|
108 |
+
|
109 |
+
```
|
110 |
+
import openvino_genai as ov_genai
|
111 |
+
import requests
|
112 |
+
from PIL import Image
|
113 |
+
from io import BytesIO
|
114 |
+
import numpy as np
|
115 |
+
import openvino as ov
|
116 |
+
|
117 |
+
device = "CPU"
|
118 |
+
pipe = ov_genai.VLMPipeline(model_path, device)
|
119 |
+
|
120 |
+
def load_image(image_file):
|
121 |
+
if isinstance(image_file, str) and (image_file.startswith("http") or image_file.startswith("https")):
|
122 |
+
response = requests.get(image_file)
|
123 |
+
image = Image.open(BytesIO(response.content)).convert("RGB")
|
124 |
+
else:
|
125 |
+
image = Image.open(image_file).convert("RGB")
|
126 |
+
image_data = np.array(image.getdata()).reshape(1, image.size[1], image.size[0], 3).astype(np.byte)
|
127 |
+
return ov.Tensor(image_data)
|
128 |
+
|
129 |
+
prompt = "What is unusual on this picture?"
|
130 |
+
|
131 |
+
url = "https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/d5fbbd1a-d484-415c-88cb-9986625b7b11"
|
132 |
+
image_tensor = load_image(url)
|
133 |
+
|
134 |
+
def streamer(subword: str) -> bool:
|
135 |
+
print(subword, end="", flush=True)
|
136 |
+
return False
|
137 |
+
|
138 |
+
pipe.start_chat()
|
139 |
+
output = pipe.generate(prompt, image=image_tensor, max_new_tokens=100, streamer=streamer)
|
140 |
+
pipe.finish_chat()
|
141 |
+
```
|
142 |
+
|
143 |
+
More GenAI usage examples can be found in OpenVINO GenAI library [docs](https://github.com/openvinotoolkit/openvino.genai/blob/master/src/README.md) and [samples](https://github.com/openvinotoolkit/openvino.genai?tab=readme-ov-file#openvino-genai-samples)
|
144 |
+
|
145 |
+
|
146 |
+
## Limitations
|
147 |
+
|
148 |
+
Check the original [model card](https://huggingface.co/OpenGVLab/InternVL2-4B) for limitations.
|
149 |
+
|
150 |
+
## Legal information
|
151 |
+
|
152 |
+
The original model is distributed under [MIT](https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/mit.md) license. More details can be found in [original model card](https://huggingface.co/OpenGVLab/InternVL2-4B).
|
153 |
+
|
154 |
+
## Disclaimer
|
155 |
+
|
156 |
+
Intel is committed to respecting human rights and avoiding causing or contributing to adverse impacts on human rights. See [Intel’s Global Human Rights Principles](https://www.intel.com/content/dam/www/central-libraries/us/en/documents/policy-human-rights.pdf). Intel’s products and software are intended only to be used in applications that do not cause or contribute to adverse impacts on human rights.
|
157 |
+
|
added_tokens.json
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"</box>": 32019,
|
3 |
+
"</img>": 32012,
|
4 |
+
"</quad>": 32015,
|
5 |
+
"</ref>": 32017,
|
6 |
+
"<IMG_CONTEXT>": 32013,
|
7 |
+
"<box>": 32018,
|
8 |
+
"<img>": 32011,
|
9 |
+
"<quad>": 32014,
|
10 |
+
"<ref>": 32016,
|
11 |
+
"<|assistant|>": 32001,
|
12 |
+
"<|endoftext|>": 32000,
|
13 |
+
"<|end|>": 32007,
|
14 |
+
"<|placeholder1|>": 32002,
|
15 |
+
"<|placeholder2|>": 32003,
|
16 |
+
"<|placeholder3|>": 32004,
|
17 |
+
"<|placeholder4|>": 32005,
|
18 |
+
"<|placeholder5|>": 32008,
|
19 |
+
"<|placeholder6|>": 32009,
|
20 |
+
"<|system|>": 32006,
|
21 |
+
"<|user|>": 32010
|
22 |
+
}
|
config.json
ADDED
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_attn_implementation_autoset": true,
|
3 |
+
"_commit_hash": null,
|
4 |
+
"architectures": [
|
5 |
+
"InternVLChatModel"
|
6 |
+
],
|
7 |
+
"auto_map": {
|
8 |
+
"AutoConfig": "configuration_internvl_chat.InternVLChatConfig",
|
9 |
+
"AutoModel": "OpenGVLab/InternVL2-4B--modeling_internvl_chat.InternVLChatModel",
|
10 |
+
"AutoModelForCausalLM": "OpenGVLab/InternVL2-4B--modeling_internvl_chat.InternVLChatModel"
|
11 |
+
},
|
12 |
+
"downsample_ratio": 0.5,
|
13 |
+
"dynamic_image_size": true,
|
14 |
+
"force_image_size": 448,
|
15 |
+
"img_context_token_id": 32013,
|
16 |
+
"llm_config": {
|
17 |
+
"_attn_implementation_autoset": true,
|
18 |
+
"_name_or_path": "microsoft/Phi-3-mini-128k-instruct",
|
19 |
+
"add_cross_attention": false,
|
20 |
+
"architectures": [
|
21 |
+
"Phi3ForCausalLM"
|
22 |
+
],
|
23 |
+
"attention_dropout": 0.0,
|
24 |
+
"auto_map": {
|
25 |
+
"AutoConfig": "configuration_phi3.Phi3Config",
|
26 |
+
"AutoModel": "modeling_phi3.Phi3ForCausalLM",
|
27 |
+
"AutoModelForCausalLM": "modeling_phi3.Phi3ForCausalLM"
|
28 |
+
},
|
29 |
+
"bad_words_ids": null,
|
30 |
+
"begin_suppress_tokens": null,
|
31 |
+
"bos_token_id": 1,
|
32 |
+
"chunk_size_feed_forward": 0,
|
33 |
+
"cross_attention_hidden_size": null,
|
34 |
+
"decoder_start_token_id": null,
|
35 |
+
"diversity_penalty": 0.0,
|
36 |
+
"do_sample": false,
|
37 |
+
"early_stopping": false,
|
38 |
+
"embd_pdrop": 0.0,
|
39 |
+
"encoder_no_repeat_ngram_size": 0,
|
40 |
+
"eos_token_id": 32000,
|
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": 3072,
|
47 |
+
"id2label": {
|
48 |
+
"0": "LABEL_0",
|
49 |
+
"1": "LABEL_1"
|
50 |
+
},
|
51 |
+
"initializer_range": 0.02,
|
52 |
+
"intermediate_size": 8192,
|
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": 131072,
|
62 |
+
"min_length": 0,
|
63 |
+
"model_type": "phi3",
|
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": 32,
|
70 |
+
"num_return_sequences": 1,
|
71 |
+
"original_max_position_embeddings": 4096,
|
72 |
+
"output_attentions": false,
|
73 |
+
"output_hidden_states": false,
|
74 |
+
"output_scores": false,
|
75 |
+
"pad_token_id": 32000,
|
76 |
+
"prefix": null,
|
77 |
+
"problem_type": null,
|
78 |
+
"pruned_heads": {},
|
79 |
+
"remove_invalid_values": false,
|
80 |
+
"repetition_penalty": 1.0,
|
81 |
+
"resid_pdrop": 0.0,
|
82 |
+
"return_dict": true,
|
83 |
+
"return_dict_in_generate": false,
|
84 |
+
"rms_norm_eps": 1e-05,
|
85 |
+
"rope_scaling": {
|
86 |
+
"long_factor": [
|
87 |
+
1.0299999713897705,
|
88 |
+
1.0499999523162842,
|
89 |
+
1.0499999523162842,
|
90 |
+
1.0799999237060547,
|
91 |
+
1.2299998998641968,
|
92 |
+
1.2299998998641968,
|
93 |
+
1.2999999523162842,
|
94 |
+
1.4499999284744263,
|
95 |
+
1.5999999046325684,
|
96 |
+
1.6499998569488525,
|
97 |
+
1.8999998569488525,
|
98 |
+
2.859999895095825,
|
99 |
+
3.68999981880188,
|
100 |
+
5.419999599456787,
|
101 |
+
5.489999771118164,
|
102 |
+
5.489999771118164,
|
103 |
+
9.09000015258789,
|
104 |
+
11.579999923706055,
|
105 |
+
15.65999984741211,
|
106 |
+
15.769999504089355,
|
107 |
+
15.789999961853027,
|
108 |
+
18.360000610351562,
|
109 |
+
21.989999771118164,
|
110 |
+
23.079999923706055,
|
111 |
+
30.009998321533203,
|
112 |
+
32.35000228881836,
|
113 |
+
32.590003967285156,
|
114 |
+
35.56000518798828,
|
115 |
+
39.95000457763672,
|
116 |
+
53.840003967285156,
|
117 |
+
56.20000457763672,
|
118 |
+
57.95000457763672,
|
119 |
+
59.29000473022461,
|
120 |
+
59.77000427246094,
|
121 |
+
59.920005798339844,
|
122 |
+
61.190006256103516,
|
123 |
+
61.96000671386719,
|
124 |
+
62.50000762939453,
|
125 |
+
63.3700065612793,
|
126 |
+
63.48000717163086,
|
127 |
+
63.48000717163086,
|
128 |
+
63.66000747680664,
|
129 |
+
63.850006103515625,
|
130 |
+
64.08000946044922,
|
131 |
+
64.760009765625,
|
132 |
+
64.80001068115234,
|
133 |
+
64.81001281738281,
|
134 |
+
64.81001281738281
|
135 |
+
],
|
136 |
+
"short_factor": [
|
137 |
+
1.05,
|
138 |
+
1.05,
|
139 |
+
1.05,
|
140 |
+
1.1,
|
141 |
+
1.1,
|
142 |
+
1.1500000000000001,
|
143 |
+
1.2000000000000002,
|
144 |
+
1.2500000000000002,
|
145 |
+
1.3000000000000003,
|
146 |
+
1.3500000000000003,
|
147 |
+
1.5000000000000004,
|
148 |
+
2.000000000000001,
|
149 |
+
2.000000000000001,
|
150 |
+
2.000000000000001,
|
151 |
+
2.000000000000001,
|
152 |
+
2.000000000000001,
|
153 |
+
2.000000000000001,
|
154 |
+
2.000000000000001,
|
155 |
+
2.000000000000001,
|
156 |
+
2.000000000000001,
|
157 |
+
2.000000000000001,
|
158 |
+
2.000000000000001,
|
159 |
+
2.000000000000001,
|
160 |
+
2.000000000000001,
|
161 |
+
2.000000000000001,
|
162 |
+
2.000000000000001,
|
163 |
+
2.000000000000001,
|
164 |
+
2.000000000000001,
|
165 |
+
2.000000000000001,
|
166 |
+
2.000000000000001,
|
167 |
+
2.000000000000001,
|
168 |
+
2.000000000000001,
|
169 |
+
2.0500000000000007,
|
170 |
+
2.0500000000000007,
|
171 |
+
2.0500000000000007,
|
172 |
+
2.1000000000000005,
|
173 |
+
2.1000000000000005,
|
174 |
+
2.1000000000000005,
|
175 |
+
2.1500000000000004,
|
176 |
+
2.1500000000000004,
|
177 |
+
2.3499999999999996,
|
178 |
+
2.549999999999999,
|
179 |
+
2.5999999999999988,
|
180 |
+
2.5999999999999988,
|
181 |
+
2.7499999999999982,
|
182 |
+
2.849999999999998,
|
183 |
+
2.849999999999998,
|
184 |
+
2.9499999999999975
|
185 |
+
],
|
186 |
+
"type": "su"
|
187 |
+
},
|
188 |
+
"rope_theta": 10000.0,
|
189 |
+
"sep_token_id": null,
|
190 |
+
"sliding_window": 262144,
|
191 |
+
"suppress_tokens": null,
|
192 |
+
"task_specific_params": null,
|
193 |
+
"temperature": 1.0,
|
194 |
+
"tf_legacy_loss": false,
|
195 |
+
"tie_encoder_decoder": false,
|
196 |
+
"tie_word_embeddings": false,
|
197 |
+
"tokenizer_class": null,
|
198 |
+
"top_k": 50,
|
199 |
+
"top_p": 1.0,
|
200 |
+
"torch_dtype": "bfloat16",
|
201 |
+
"torchscript": false,
|
202 |
+
"transformers_version": "4.51.3",
|
203 |
+
"typical_p": 1.0,
|
204 |
+
"use_bfloat16": true,
|
205 |
+
"use_cache": true,
|
206 |
+
"vocab_size": 32020
|
207 |
+
},
|
208 |
+
"max_dynamic_patch": 12,
|
209 |
+
"min_dynamic_patch": 1,
|
210 |
+
"model_type": "internvl_chat",
|
211 |
+
"ps_version": "v2",
|
212 |
+
"select_layer": -1,
|
213 |
+
"template": "phi3-chat",
|
214 |
+
"tie_word_embeddings": false,
|
215 |
+
"torch_dtype": "bfloat16",
|
216 |
+
"transformers_version": null,
|
217 |
+
"use_backbone_lora": 0,
|
218 |
+
"use_llm_lora": 0,
|
219 |
+
"use_thumbnail": true,
|
220 |
+
"vision_config": {
|
221 |
+
"_attn_implementation_autoset": true,
|
222 |
+
"_name_or_path": "",
|
223 |
+
"add_cross_attention": false,
|
224 |
+
"architectures": [
|
225 |
+
"InternVisionModel"
|
226 |
+
],
|
227 |
+
"attention_dropout": 0.0,
|
228 |
+
"bad_words_ids": null,
|
229 |
+
"begin_suppress_tokens": null,
|
230 |
+
"bos_token_id": null,
|
231 |
+
"chunk_size_feed_forward": 0,
|
232 |
+
"cross_attention_hidden_size": null,
|
233 |
+
"decoder_start_token_id": null,
|
234 |
+
"diversity_penalty": 0.0,
|
235 |
+
"do_sample": false,
|
236 |
+
"drop_path_rate": 0.0,
|
237 |
+
"dropout": 0.0,
|
238 |
+
"early_stopping": false,
|
239 |
+
"encoder_no_repeat_ngram_size": 0,
|
240 |
+
"eos_token_id": null,
|
241 |
+
"exponential_decay_length_penalty": null,
|
242 |
+
"finetuning_task": null,
|
243 |
+
"forced_bos_token_id": null,
|
244 |
+
"forced_eos_token_id": null,
|
245 |
+
"hidden_act": "gelu",
|
246 |
+
"hidden_size": 1024,
|
247 |
+
"id2label": {
|
248 |
+
"0": "LABEL_0",
|
249 |
+
"1": "LABEL_1"
|
250 |
+
},
|
251 |
+
"image_size": 448,
|
252 |
+
"initializer_factor": 1.0,
|
253 |
+
"initializer_range": 0.02,
|
254 |
+
"intermediate_size": 4096,
|
255 |
+
"is_decoder": false,
|
256 |
+
"is_encoder_decoder": false,
|
257 |
+
"label2id": {
|
258 |
+
"LABEL_0": 0,
|
259 |
+
"LABEL_1": 1
|
260 |
+
},
|
261 |
+
"layer_norm_eps": 1e-06,
|
262 |
+
"length_penalty": 1.0,
|
263 |
+
"max_length": 20,
|
264 |
+
"min_length": 0,
|
265 |
+
"model_type": "intern_vit_6b",
|
266 |
+
"no_repeat_ngram_size": 0,
|
267 |
+
"norm_type": "layer_norm",
|
268 |
+
"num_attention_heads": 16,
|
269 |
+
"num_beam_groups": 1,
|
270 |
+
"num_beams": 1,
|
271 |
+
"num_channels": 3,
|
272 |
+
"num_hidden_layers": 24,
|
273 |
+
"num_return_sequences": 1,
|
274 |
+
"output_attentions": false,
|
275 |
+
"output_hidden_states": false,
|
276 |
+
"output_scores": false,
|
277 |
+
"pad_token_id": null,
|
278 |
+
"patch_size": 14,
|
279 |
+
"prefix": null,
|
280 |
+
"problem_type": null,
|
281 |
+
"pruned_heads": {},
|
282 |
+
"qk_normalization": false,
|
283 |
+
"qkv_bias": true,
|
284 |
+
"remove_invalid_values": false,
|
285 |
+
"repetition_penalty": 1.0,
|
286 |
+
"return_dict": true,
|
287 |
+
"return_dict_in_generate": false,
|
288 |
+
"sep_token_id": null,
|
289 |
+
"suppress_tokens": null,
|
290 |
+
"task_specific_params": null,
|
291 |
+
"temperature": 1.0,
|
292 |
+
"tf_legacy_loss": false,
|
293 |
+
"tie_encoder_decoder": false,
|
294 |
+
"tie_word_embeddings": true,
|
295 |
+
"tokenizer_class": null,
|
296 |
+
"top_k": 50,
|
297 |
+
"top_p": 1.0,
|
298 |
+
"torch_dtype": "bfloat16",
|
299 |
+
"torchscript": false,
|
300 |
+
"transformers_version": "4.51.3",
|
301 |
+
"typical_p": 1.0,
|
302 |
+
"use_bfloat16": true,
|
303 |
+
"use_flash_attn": false
|
304 |
+
}
|
305 |
+
}
|
configuration_intern_vit.py
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# --------------------------------------------------------
|
2 |
+
# InternVL
|
3 |
+
# Copyright (c) 2024 OpenGVLab
|
4 |
+
# Licensed under The MIT License [see LICENSE for details]
|
5 |
+
# --------------------------------------------------------
|
6 |
+
|
7 |
+
import os
|
8 |
+
from typing import Union
|
9 |
+
|
10 |
+
from transformers.configuration_utils import PretrainedConfig
|
11 |
+
from transformers.utils import logging
|
12 |
+
|
13 |
+
logger = logging.get_logger(__name__)
|
14 |
+
|
15 |
+
|
16 |
+
class InternVisionConfig(PretrainedConfig):
|
17 |
+
r"""
|
18 |
+
This is the configuration class to store the configuration of a [`InternVisionModel`]. It is used to
|
19 |
+
instantiate a vision encoder according to the specified arguments, defining the model architecture.
|
20 |
+
|
21 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
22 |
+
documentation from [`PretrainedConfig`] for more information.
|
23 |
+
|
24 |
+
Args:
|
25 |
+
num_channels (`int`, *optional*, defaults to 3):
|
26 |
+
Number of color channels in the input images (e.g., 3 for RGB).
|
27 |
+
patch_size (`int`, *optional*, defaults to 14):
|
28 |
+
The size (resolution) of each patch.
|
29 |
+
image_size (`int`, *optional*, defaults to 224):
|
30 |
+
The size (resolution) of each image.
|
31 |
+
qkv_bias (`bool`, *optional*, defaults to `False`):
|
32 |
+
Whether to add a bias to the queries and values in the self-attention layers.
|
33 |
+
hidden_size (`int`, *optional*, defaults to 3200):
|
34 |
+
Dimensionality of the encoder layers and the pooler layer.
|
35 |
+
num_attention_heads (`int`, *optional*, defaults to 25):
|
36 |
+
Number of attention heads for each attention layer in the Transformer encoder.
|
37 |
+
intermediate_size (`int`, *optional*, defaults to 12800):
|
38 |
+
Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
|
39 |
+
qk_normalization (`bool`, *optional*, defaults to `True`):
|
40 |
+
Whether to normalize the queries and keys in the self-attention layers.
|
41 |
+
num_hidden_layers (`int`, *optional*, defaults to 48):
|
42 |
+
Number of hidden layers in the Transformer encoder.
|
43 |
+
use_flash_attn (`bool`, *optional*, defaults to `True`):
|
44 |
+
Whether to use flash attention mechanism.
|
45 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"gelu"`):
|
46 |
+
The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
|
47 |
+
`"relu"`, `"selu"` and `"gelu_new"` ``"gelu"` are supported.
|
48 |
+
layer_norm_eps (`float`, *optional*, defaults to 1e-6):
|
49 |
+
The epsilon used by the layer normalization layers.
|
50 |
+
dropout (`float`, *optional*, defaults to 0.0):
|
51 |
+
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
|
52 |
+
drop_path_rate (`float`, *optional*, defaults to 0.0):
|
53 |
+
Dropout rate for stochastic depth.
|
54 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
55 |
+
The dropout ratio for the attention probabilities.
|
56 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
57 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
58 |
+
initializer_factor (`float`, *optional*, defaults to 0.1):
|
59 |
+
A factor for layer scale.
|
60 |
+
"""
|
61 |
+
|
62 |
+
model_type = 'intern_vit_6b'
|
63 |
+
|
64 |
+
def __init__(
|
65 |
+
self,
|
66 |
+
num_channels=3,
|
67 |
+
patch_size=14,
|
68 |
+
image_size=224,
|
69 |
+
qkv_bias=False,
|
70 |
+
hidden_size=3200,
|
71 |
+
num_attention_heads=25,
|
72 |
+
intermediate_size=12800,
|
73 |
+
qk_normalization=True,
|
74 |
+
num_hidden_layers=48,
|
75 |
+
use_flash_attn=True,
|
76 |
+
hidden_act='gelu',
|
77 |
+
norm_type='rms_norm',
|
78 |
+
layer_norm_eps=1e-6,
|
79 |
+
dropout=0.0,
|
80 |
+
drop_path_rate=0.0,
|
81 |
+
attention_dropout=0.0,
|
82 |
+
initializer_range=0.02,
|
83 |
+
initializer_factor=0.1,
|
84 |
+
**kwargs,
|
85 |
+
):
|
86 |
+
super().__init__(**kwargs)
|
87 |
+
|
88 |
+
self.hidden_size = hidden_size
|
89 |
+
self.intermediate_size = intermediate_size
|
90 |
+
self.dropout = dropout
|
91 |
+
self.drop_path_rate = drop_path_rate
|
92 |
+
self.num_hidden_layers = num_hidden_layers
|
93 |
+
self.num_attention_heads = num_attention_heads
|
94 |
+
self.num_channels = num_channels
|
95 |
+
self.patch_size = patch_size
|
96 |
+
self.image_size = image_size
|
97 |
+
self.initializer_range = initializer_range
|
98 |
+
self.initializer_factor = initializer_factor
|
99 |
+
self.attention_dropout = attention_dropout
|
100 |
+
self.layer_norm_eps = layer_norm_eps
|
101 |
+
self.hidden_act = hidden_act
|
102 |
+
self.norm_type = norm_type
|
103 |
+
self.qkv_bias = qkv_bias
|
104 |
+
self.qk_normalization = qk_normalization
|
105 |
+
self.use_flash_attn = use_flash_attn
|
106 |
+
|
107 |
+
@classmethod
|
108 |
+
def from_pretrained(cls, pretrained_model_name_or_path: Union[str, os.PathLike], **kwargs) -> 'PretrainedConfig':
|
109 |
+
config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
|
110 |
+
|
111 |
+
if 'vision_config' in config_dict:
|
112 |
+
config_dict = config_dict['vision_config']
|
113 |
+
|
114 |
+
if 'model_type' in config_dict and hasattr(cls, 'model_type') and config_dict['model_type'] != cls.model_type:
|
115 |
+
logger.warning(
|
116 |
+
f"You are using a model of type {config_dict['model_type']} to instantiate a model of type "
|
117 |
+
f'{cls.model_type}. This is not supported for all configurations of models and can yield errors.'
|
118 |
+
)
|
119 |
+
|
120 |
+
return cls.from_dict(config_dict, **kwargs)
|
configuration_internvl_chat.py
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# --------------------------------------------------------
|
2 |
+
# InternVL
|
3 |
+
# Copyright (c) 2024 OpenGVLab
|
4 |
+
# Licensed under The MIT License [see LICENSE for details]
|
5 |
+
# --------------------------------------------------------
|
6 |
+
|
7 |
+
import copy
|
8 |
+
|
9 |
+
from transformers import AutoConfig, LlamaConfig
|
10 |
+
from transformers.configuration_utils import PretrainedConfig
|
11 |
+
from transformers.utils import logging
|
12 |
+
|
13 |
+
from .configuration_intern_vit import InternVisionConfig
|
14 |
+
from .configuration_phi3 import Phi3Config
|
15 |
+
|
16 |
+
logger = logging.get_logger(__name__)
|
17 |
+
|
18 |
+
|
19 |
+
class InternVLChatConfig(PretrainedConfig):
|
20 |
+
model_type = 'internvl_chat'
|
21 |
+
is_composition = True
|
22 |
+
|
23 |
+
def __init__(
|
24 |
+
self,
|
25 |
+
vision_config=None,
|
26 |
+
llm_config=None,
|
27 |
+
use_backbone_lora=0,
|
28 |
+
use_llm_lora=0,
|
29 |
+
select_layer=-1,
|
30 |
+
force_image_size=None,
|
31 |
+
downsample_ratio=0.5,
|
32 |
+
template=None,
|
33 |
+
dynamic_image_size=False,
|
34 |
+
use_thumbnail=False,
|
35 |
+
ps_version='v1',
|
36 |
+
min_dynamic_patch=1,
|
37 |
+
max_dynamic_patch=6,
|
38 |
+
**kwargs):
|
39 |
+
super().__init__(**kwargs)
|
40 |
+
|
41 |
+
if vision_config is None:
|
42 |
+
vision_config = {'architectures': ['InternVisionModel']}
|
43 |
+
logger.info('vision_config is None. Initializing the InternVisionConfig with default values.')
|
44 |
+
|
45 |
+
if llm_config is None:
|
46 |
+
llm_config = {'architectures': ['Phi3ForCausalLM']}
|
47 |
+
logger.info('llm_config is None. Initializing the LlamaConfig config with default values (`LlamaConfig`).')
|
48 |
+
|
49 |
+
self.vision_config = InternVisionConfig(**vision_config)
|
50 |
+
if llm_config.get('architectures')[0] == 'LlamaForCausalLM':
|
51 |
+
self.llm_config = LlamaConfig(**llm_config)
|
52 |
+
elif llm_config.get('architectures')[0] == 'Phi3ForCausalLM':
|
53 |
+
self.llm_config = Phi3Config(**llm_config)
|
54 |
+
else:
|
55 |
+
raise ValueError('Unsupported architecture: {}'.format(llm_config.get('architectures')[0]))
|
56 |
+
self.use_backbone_lora = use_backbone_lora
|
57 |
+
self.use_llm_lora = use_llm_lora
|
58 |
+
self.select_layer = select_layer
|
59 |
+
self.force_image_size = force_image_size
|
60 |
+
self.downsample_ratio = downsample_ratio
|
61 |
+
self.template = template
|
62 |
+
self.dynamic_image_size = dynamic_image_size
|
63 |
+
self.use_thumbnail = use_thumbnail
|
64 |
+
self.ps_version = ps_version # pixel shuffle version
|
65 |
+
self.min_dynamic_patch = min_dynamic_patch
|
66 |
+
self.max_dynamic_patch = max_dynamic_patch
|
67 |
+
# By default, we use tie_word_embeddings=False for models of all sizes.
|
68 |
+
self.tie_word_embeddings = self.llm_config.tie_word_embeddings
|
69 |
+
|
70 |
+
logger.info(f'vision_select_layer: {self.select_layer}')
|
71 |
+
logger.info(f'ps_version: {self.ps_version}')
|
72 |
+
logger.info(f'min_dynamic_patch: {self.min_dynamic_patch}')
|
73 |
+
logger.info(f'max_dynamic_patch: {self.max_dynamic_patch}')
|
74 |
+
|
75 |
+
def to_dict(self):
|
76 |
+
"""
|
77 |
+
Serializes this instance to a Python dictionary. Override the default [`~PretrainedConfig.to_dict`].
|
78 |
+
|
79 |
+
Returns:
|
80 |
+
`Dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
|
81 |
+
"""
|
82 |
+
output = copy.deepcopy(self.__dict__)
|
83 |
+
output['vision_config'] = self.vision_config.to_dict()
|
84 |
+
output['llm_config'] = self.llm_config.to_dict()
|
85 |
+
output['model_type'] = self.__class__.model_type
|
86 |
+
output['use_backbone_lora'] = self.use_backbone_lora
|
87 |
+
output['use_llm_lora'] = self.use_llm_lora
|
88 |
+
output['select_layer'] = self.select_layer
|
89 |
+
output['force_image_size'] = self.force_image_size
|
90 |
+
output['downsample_ratio'] = self.downsample_ratio
|
91 |
+
output['template'] = self.template
|
92 |
+
output['dynamic_image_size'] = self.dynamic_image_size
|
93 |
+
output['use_thumbnail'] = self.use_thumbnail
|
94 |
+
output['ps_version'] = self.ps_version
|
95 |
+
output['min_dynamic_patch'] = self.min_dynamic_patch
|
96 |
+
output['max_dynamic_patch'] = self.max_dynamic_patch
|
97 |
+
|
98 |
+
return output
|
configuration_phi3.py
ADDED
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright 2024 Microsoft and the HuggingFace Inc. team. All rights reserved.
|
2 |
+
#
|
3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
+
# you may not use this file except in compliance with the License.
|
5 |
+
# You may obtain a copy of the License atd
|
6 |
+
#
|
7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
+
#
|
9 |
+
# Unless required by applicable law or agreed to in writing, software
|
10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
+
# See the License for the specific language governing permissions and
|
13 |
+
# limitations under the License.
|
14 |
+
|
15 |
+
""" Phi-3 model configuration"""
|
16 |
+
|
17 |
+
|
18 |
+
from transformers.configuration_utils import PretrainedConfig
|
19 |
+
from transformers.utils import logging
|
20 |
+
|
21 |
+
logger = logging.get_logger(__name__)
|
22 |
+
|
23 |
+
PHI3_PRETRAINED_CONFIG_ARCHIVE_MAP = {
|
24 |
+
'microsoft/Phi-3-mini-4k-instruct': 'https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/resolve/main/config.json',
|
25 |
+
'microsoft/Phi-3-mini-128k-instruct': 'https://huggingface.co/microsoft/Phi-3-mini-128k-instruct/resolve/main/config.json',
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
class Phi3Config(PretrainedConfig):
|
30 |
+
r"""
|
31 |
+
This is the configuration class to store the configuration of a [`Phi3Model`]. It is used to instantiate a Phi-3
|
32 |
+
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
33 |
+
defaults will yield a similar configuration to that of the
|
34 |
+
[microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct).
|
35 |
+
|
36 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
37 |
+
documentation from [`PretrainedConfig`] for more information.
|
38 |
+
|
39 |
+
Args:
|
40 |
+
vocab_size (`int`, *optional*, defaults to 32064):
|
41 |
+
Vocabulary size of the Phi-3 model. Defines the number of different tokens that can be represented by the
|
42 |
+
`inputs_ids` passed when calling [`Phi3Model`].
|
43 |
+
hidden_size (`int`, *optional*, defaults to 3072):
|
44 |
+
Dimension of the hidden representations.
|
45 |
+
intermediate_size (`int`, *optional*, defaults to 8192):
|
46 |
+
Dimension of the MLP representations.
|
47 |
+
num_hidden_layers (`int`, *optional*, defaults to 32):
|
48 |
+
Number of hidden layers in the Transformer decoder.
|
49 |
+
num_attention_heads (`int`, *optional*, defaults to 32):
|
50 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
51 |
+
num_key_value_heads (`int`, *optional*):
|
52 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
53 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
54 |
+
`num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
|
55 |
+
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
|
56 |
+
by meanpooling all the original heads within that group. For more details checkout [this
|
57 |
+
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
|
58 |
+
`num_attention_heads`.
|
59 |
+
resid_pdrop (`float`, *optional*, defaults to 0.0):
|
60 |
+
Dropout probability for mlp outputs.
|
61 |
+
embd_pdrop (`int`, *optional*, defaults to 0.0):
|
62 |
+
The dropout ratio for the embeddings.
|
63 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
64 |
+
The dropout ratio after computing the attention scores.
|
65 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
66 |
+
The non-linear activation function (function or string) in the decoder.
|
67 |
+
max_position_embeddings (`int`, *optional*, defaults to 4096):
|
68 |
+
The maximum sequence length that this model might ever be used with.
|
69 |
+
original_max_position_embeddings (`int`, *optional*, defaults to 4096):
|
70 |
+
The maximum sequence length that this model was trained with. This is used to determine the size of the
|
71 |
+
original RoPE embeddings when using long scaling.
|
72 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
73 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
74 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-05):
|
75 |
+
The epsilon value used for the RMSNorm.
|
76 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
77 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
78 |
+
relevant if `config.is_decoder=True`. Whether to tie weight embeddings or not.
|
79 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
80 |
+
Whether to tie weight embeddings
|
81 |
+
rope_theta (`float`, *optional*, defaults to 10000.0):
|
82 |
+
The base period of the RoPE embeddings.
|
83 |
+
rope_scaling (`dict`, *optional*):
|
84 |
+
The scaling strategy for the RoPE embeddings. If `None`, no scaling is applied. If a dictionary, it must
|
85 |
+
contain the following keys: `type`, `short_factor` and `long_factor`. The `type` must be either `su` or `yarn` and
|
86 |
+
the `short_factor` and `long_factor` must be lists of numbers with the same length as the hidden size
|
87 |
+
divided by the number of attention heads divided by 2.
|
88 |
+
bos_token_id (`int`, *optional*, defaults to 1):
|
89 |
+
The id of the "beginning-of-sequence" token.
|
90 |
+
eos_token_id (`int`, *optional*, defaults to 32000):
|
91 |
+
The id of the "end-of-sequence" token.
|
92 |
+
pad_token_id (`int`, *optional*, defaults to 32000):
|
93 |
+
The id of the padding token.
|
94 |
+
sliding_window (`int`, *optional*):
|
95 |
+
Sliding window attention window size. If `None`, no sliding window is applied.
|
96 |
+
|
97 |
+
Example:
|
98 |
+
|
99 |
+
```python
|
100 |
+
>>> from transformers import Phi3Model, Phi3Config
|
101 |
+
|
102 |
+
>>> # Initializing a Phi-3 style configuration
|
103 |
+
>>> configuration = Phi3Config.from_pretrained("microsoft/Phi-3-mini-4k-instruct")
|
104 |
+
|
105 |
+
>>> # Initializing a model from the configuration
|
106 |
+
>>> model = Phi3Model(configuration)
|
107 |
+
|
108 |
+
>>> # Accessing the model configuration
|
109 |
+
>>> configuration = model.config
|
110 |
+
```"""
|
111 |
+
|
112 |
+
model_type = 'phi3'
|
113 |
+
keys_to_ignore_at_inference = ['past_key_values']
|
114 |
+
|
115 |
+
def __init__(
|
116 |
+
self,
|
117 |
+
vocab_size=32064,
|
118 |
+
hidden_size=3072,
|
119 |
+
intermediate_size=8192,
|
120 |
+
num_hidden_layers=32,
|
121 |
+
num_attention_heads=32,
|
122 |
+
num_key_value_heads=None,
|
123 |
+
resid_pdrop=0.0,
|
124 |
+
embd_pdrop=0.0,
|
125 |
+
attention_dropout=0.0,
|
126 |
+
hidden_act='silu',
|
127 |
+
max_position_embeddings=4096,
|
128 |
+
original_max_position_embeddings=4096,
|
129 |
+
initializer_range=0.02,
|
130 |
+
rms_norm_eps=1e-5,
|
131 |
+
use_cache=True,
|
132 |
+
tie_word_embeddings=False,
|
133 |
+
rope_theta=10000.0,
|
134 |
+
rope_scaling=None,
|
135 |
+
bos_token_id=1,
|
136 |
+
eos_token_id=32000,
|
137 |
+
pad_token_id=32000,
|
138 |
+
sliding_window=None,
|
139 |
+
**kwargs,
|
140 |
+
):
|
141 |
+
self.vocab_size = vocab_size
|
142 |
+
self.hidden_size = hidden_size
|
143 |
+
self.intermediate_size = intermediate_size
|
144 |
+
self.num_hidden_layers = num_hidden_layers
|
145 |
+
self.num_attention_heads = num_attention_heads
|
146 |
+
|
147 |
+
if num_key_value_heads is None:
|
148 |
+
num_key_value_heads = num_attention_heads
|
149 |
+
|
150 |
+
self.num_key_value_heads = num_key_value_heads
|
151 |
+
self.resid_pdrop = resid_pdrop
|
152 |
+
self.embd_pdrop = embd_pdrop
|
153 |
+
self.attention_dropout = attention_dropout
|
154 |
+
self.hidden_act = hidden_act
|
155 |
+
self.max_position_embeddings = max_position_embeddings
|
156 |
+
self.original_max_position_embeddings = original_max_position_embeddings
|
157 |
+
self.initializer_range = initializer_range
|
158 |
+
self.rms_norm_eps = rms_norm_eps
|
159 |
+
self.use_cache = use_cache
|
160 |
+
self.rope_theta = rope_theta
|
161 |
+
self.rope_scaling = rope_scaling
|
162 |
+
self._rope_scaling_validation()
|
163 |
+
self.sliding_window = sliding_window
|
164 |
+
|
165 |
+
super().__init__(
|
166 |
+
bos_token_id=bos_token_id,
|
167 |
+
eos_token_id=eos_token_id,
|
168 |
+
pad_token_id=pad_token_id,
|
169 |
+
tie_word_embeddings=tie_word_embeddings,
|
170 |
+
**kwargs,
|
171 |
+
)
|
172 |
+
|
173 |
+
def _rope_scaling_validation(self):
|
174 |
+
"""
|
175 |
+
Validate the `rope_scaling` configuration.
|
176 |
+
"""
|
177 |
+
if self.rope_scaling is None:
|
178 |
+
return
|
179 |
+
|
180 |
+
if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 3:
|
181 |
+
raise ValueError(
|
182 |
+
'`rope_scaling` must be a dictionary with three fields, `type`, `short_factor` and `long_factor`, '
|
183 |
+
f'got {self.rope_scaling}'
|
184 |
+
)
|
185 |
+
rope_scaling_type = self.rope_scaling.get('type', None)
|
186 |
+
rope_scaling_short_factor = self.rope_scaling.get('short_factor', None)
|
187 |
+
rope_scaling_long_factor = self.rope_scaling.get('long_factor', None)
|
188 |
+
if rope_scaling_type is None or rope_scaling_type not in ['su', 'yarn']:
|
189 |
+
raise ValueError(f"`rope_scaling`'s type field must be one of ['su', 'yarn'], got {rope_scaling_type}")
|
190 |
+
if not (
|
191 |
+
isinstance(rope_scaling_short_factor, list)
|
192 |
+
and all(isinstance(x, (int, float)) for x in rope_scaling_short_factor)
|
193 |
+
):
|
194 |
+
raise ValueError(
|
195 |
+
f"`rope_scaling`'s short_factor field must be a list of numbers, got {rope_scaling_short_factor}"
|
196 |
+
)
|
197 |
+
if not len(rope_scaling_short_factor) == self.hidden_size // self.num_attention_heads // 2:
|
198 |
+
raise ValueError(
|
199 |
+
f"`rope_scaling`'s short_factor field must have length {self.hidden_size // self.num_attention_heads // 2}, got {len(rope_scaling_short_factor)}"
|
200 |
+
)
|
201 |
+
if not (
|
202 |
+
isinstance(rope_scaling_long_factor, list)
|
203 |
+
and all(isinstance(x, (int, float)) for x in rope_scaling_long_factor)
|
204 |
+
):
|
205 |
+
raise ValueError(
|
206 |
+
f"`rope_scaling`'s long_factor field must be a list of numbers, got {rope_scaling_long_factor}"
|
207 |
+
)
|
208 |
+
if not len(rope_scaling_long_factor) == self.hidden_size // self.num_attention_heads // 2:
|
209 |
+
raise ValueError(
|
210 |
+
f"`rope_scaling`'s long_factor field must have length {self.hidden_size // self.num_attention_heads // 2}, got {len(rope_scaling_long_factor)}"
|
211 |
+
)
|
generation_config.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"eos_token_id": [
|
4 |
+
2,
|
5 |
+
32000,
|
6 |
+
32007
|
7 |
+
],
|
8 |
+
"transformers_version": "4.51.3"
|
9 |
+
}
|
openvino_config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"dtype": "int4",
|
3 |
+
"input_info": null,
|
4 |
+
"optimum_version": "1.27.0",
|
5 |
+
"quantization_config": {
|
6 |
+
"all_layers": null,
|
7 |
+
"backup_precision": null,
|
8 |
+
"bits": 4,
|
9 |
+
"dataset": "contextual",
|
10 |
+
"dtype": "int4",
|
11 |
+
"gptq": null,
|
12 |
+
"group_size": 128,
|
13 |
+
"ignored_scope": null,
|
14 |
+
"lora_correction": null,
|
15 |
+
"num_samples": 32,
|
16 |
+
"processor": null,
|
17 |
+
"quant_method": "awq",
|
18 |
+
"ratio": 1.0,
|
19 |
+
"scale_estimation": null,
|
20 |
+
"sensitivity_metric": null,
|
21 |
+
"statistics_path": null,
|
22 |
+
"sym": false,
|
23 |
+
"tokenizer": null,
|
24 |
+
"trust_remote_code": true
|
25 |
+
},
|
26 |
+
"save_onnx_model": false,
|
27 |
+
"transformers_version": "4.51.3"
|
28 |
+
}
|
openvino_detokenizer.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cf70205700cbd2329859534c9ea0becf346d4680afffcdcaba96b83bfaf41197
|
3 |
+
size 467406
|
openvino_detokenizer.xml
ADDED
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<net name="detokenizer" version="11">
|
3 |
+
<layers>
|
4 |
+
<layer id="0" name="Parameter_1459339" type="Parameter" version="opset1">
|
5 |
+
<data shape="?,?" element_type="i64" />
|
6 |
+
<output>
|
7 |
+
<port id="0" precision="I64" names="Parameter_1459339">
|
8 |
+
<dim>-1</dim>
|
9 |
+
<dim>-1</dim>
|
10 |
+
</port>
|
11 |
+
</output>
|
12 |
+
</layer>
|
13 |
+
<layer id="1" name="Convert_1459534" type="Convert" version="opset1">
|
14 |
+
<data destination_type="i32" />
|
15 |
+
<input>
|
16 |
+
<port id="0" precision="I64">
|
17 |
+
<dim>-1</dim>
|
18 |
+
<dim>-1</dim>
|
19 |
+
</port>
|
20 |
+
</input>
|
21 |
+
<output>
|
22 |
+
<port id="1" precision="I32">
|
23 |
+
<dim>-1</dim>
|
24 |
+
<dim>-1</dim>
|
25 |
+
</port>
|
26 |
+
</output>
|
27 |
+
</layer>
|
28 |
+
<layer id="2" name="Constant_1459292" type="Const" version="opset1">
|
29 |
+
<data element_type="i32" shape="32020" offset="0" size="128080" />
|
30 |
+
<output>
|
31 |
+
<port id="0" precision="I32">
|
32 |
+
<dim>32020</dim>
|
33 |
+
</port>
|
34 |
+
</output>
|
35 |
+
</layer>
|
36 |
+
<layer id="3" name="Constant_1459294" type="Const" version="opset1">
|
37 |
+
<data element_type="i32" shape="32020" offset="128080" size="128080" />
|
38 |
+
<output>
|
39 |
+
<port id="0" precision="I32">
|
40 |
+
<dim>32020</dim>
|
41 |
+
</port>
|
42 |
+
</output>
|
43 |
+
</layer>
|
44 |
+
<layer id="4" name="Constant_1459296" type="Const" version="opset1">
|
45 |
+
<data element_type="u8" shape="211147" offset="256160" size="211147" />
|
46 |
+
<output>
|
47 |
+
<port id="0" precision="U8">
|
48 |
+
<dim>211147</dim>
|
49 |
+
</port>
|
50 |
+
</output>
|
51 |
+
</layer>
|
52 |
+
<layer id="5" name="Slice_1459344" type="Const" version="opset1">
|
53 |
+
<data element_type="i32" shape="23" offset="467307" size="92" />
|
54 |
+
<output>
|
55 |
+
<port id="0" precision="I32">
|
56 |
+
<dim>23</dim>
|
57 |
+
</port>
|
58 |
+
</output>
|
59 |
+
</layer>
|
60 |
+
<layer id="6" name="VocabDecoder_1459346" type="VocabDecoder" version="extension">
|
61 |
+
<data skip_tokens="" />
|
62 |
+
<input>
|
63 |
+
<port id="0" precision="I32">
|
64 |
+
<dim>-1</dim>
|
65 |
+
<dim>-1</dim>
|
66 |
+
</port>
|
67 |
+
<port id="1" precision="I32">
|
68 |
+
<dim>32020</dim>
|
69 |
+
</port>
|
70 |
+
<port id="2" precision="I32">
|
71 |
+
<dim>32020</dim>
|
72 |
+
</port>
|
73 |
+
<port id="3" precision="U8">
|
74 |
+
<dim>211147</dim>
|
75 |
+
</port>
|
76 |
+
<port id="4" precision="I32">
|
77 |
+
<dim>23</dim>
|
78 |
+
</port>
|
79 |
+
</input>
|
80 |
+
<output>
|
81 |
+
<port id="5" precision="I32">
|
82 |
+
<dim>-1</dim>
|
83 |
+
</port>
|
84 |
+
<port id="6" precision="I32">
|
85 |
+
<dim>-1</dim>
|
86 |
+
</port>
|
87 |
+
<port id="7" precision="I32">
|
88 |
+
<dim>-1</dim>
|
89 |
+
</port>
|
90 |
+
<port id="8" precision="I32">
|
91 |
+
<dim>-1</dim>
|
92 |
+
</port>
|
93 |
+
<port id="9" precision="U8">
|
94 |
+
<dim>-1</dim>
|
95 |
+
</port>
|
96 |
+
</output>
|
97 |
+
</layer>
|
98 |
+
<layer id="7" name="Constant_1459348" type="Const" version="opset1">
|
99 |
+
<data element_type="u8" shape="3" offset="467399" size="3" />
|
100 |
+
<output>
|
101 |
+
<port id="0" precision="U8">
|
102 |
+
<dim>3</dim>
|
103 |
+
</port>
|
104 |
+
</output>
|
105 |
+
</layer>
|
106 |
+
<layer id="8" name="Constant_1459350" type="Const" version="opset1">
|
107 |
+
<data element_type="u8" shape="1" offset="467402" size="1" />
|
108 |
+
<output>
|
109 |
+
<port id="0" precision="U8">
|
110 |
+
<dim>1</dim>
|
111 |
+
</port>
|
112 |
+
</output>
|
113 |
+
</layer>
|
114 |
+
<layer id="9" name="RegexNormalization_1459351" type="RegexNormalization" version="extension">
|
115 |
+
<data global_replace="true" />
|
116 |
+
<input>
|
117 |
+
<port id="0" precision="I32">
|
118 |
+
<dim>-1</dim>
|
119 |
+
</port>
|
120 |
+
<port id="1" precision="I32">
|
121 |
+
<dim>-1</dim>
|
122 |
+
</port>
|
123 |
+
<port id="2" precision="U8">
|
124 |
+
<dim>-1</dim>
|
125 |
+
</port>
|
126 |
+
<port id="3" precision="U8">
|
127 |
+
<dim>3</dim>
|
128 |
+
</port>
|
129 |
+
<port id="4" precision="U8">
|
130 |
+
<dim>1</dim>
|
131 |
+
</port>
|
132 |
+
</input>
|
133 |
+
<output>
|
134 |
+
<port id="5" precision="I32">
|
135 |
+
<dim>-1</dim>
|
136 |
+
</port>
|
137 |
+
<port id="6" precision="I32">
|
138 |
+
<dim>-1</dim>
|
139 |
+
</port>
|
140 |
+
<port id="7" precision="U8">
|
141 |
+
<dim>-1</dim>
|
142 |
+
</port>
|
143 |
+
</output>
|
144 |
+
</layer>
|
145 |
+
<layer id="10" name="ByteFallback_1459352" type="ByteFallback" version="extension">
|
146 |
+
<input>
|
147 |
+
<port id="0" precision="I32">
|
148 |
+
<dim>-1</dim>
|
149 |
+
</port>
|
150 |
+
<port id="1" precision="I32">
|
151 |
+
<dim>-1</dim>
|
152 |
+
</port>
|
153 |
+
<port id="2" precision="U8">
|
154 |
+
<dim>-1</dim>
|
155 |
+
</port>
|
156 |
+
</input>
|
157 |
+
<output>
|
158 |
+
<port id="3" precision="I32">
|
159 |
+
<dim>-1</dim>
|
160 |
+
</port>
|
161 |
+
<port id="4" precision="I32">
|
162 |
+
<dim>-1</dim>
|
163 |
+
</port>
|
164 |
+
<port id="5" precision="U8">
|
165 |
+
<dim>-1</dim>
|
166 |
+
</port>
|
167 |
+
</output>
|
168 |
+
</layer>
|
169 |
+
<layer id="11" name="FuzeRagged_1459353" type="FuzeRagged" version="extension">
|
170 |
+
<input>
|
171 |
+
<port id="0" precision="I32">
|
172 |
+
<dim>-1</dim>
|
173 |
+
</port>
|
174 |
+
<port id="1" precision="I32">
|
175 |
+
<dim>-1</dim>
|
176 |
+
</port>
|
177 |
+
<port id="2" precision="I32">
|
178 |
+
<dim>-1</dim>
|
179 |
+
</port>
|
180 |
+
<port id="3" precision="I32">
|
181 |
+
<dim>-1</dim>
|
182 |
+
</port>
|
183 |
+
</input>
|
184 |
+
<output>
|
185 |
+
<port id="4" precision="I32">
|
186 |
+
<dim>-1</dim>
|
187 |
+
</port>
|
188 |
+
<port id="5" precision="I32">
|
189 |
+
<dim>-1</dim>
|
190 |
+
</port>
|
191 |
+
</output>
|
192 |
+
</layer>
|
193 |
+
<layer id="12" name="Constant_1459355" type="Const" version="opset1">
|
194 |
+
<data element_type="u8" shape="2" offset="467403" size="2" />
|
195 |
+
<output>
|
196 |
+
<port id="0" precision="U8">
|
197 |
+
<dim>2</dim>
|
198 |
+
</port>
|
199 |
+
</output>
|
200 |
+
</layer>
|
201 |
+
<layer id="13" name="Constant_1459357" type="Const" version="opset1">
|
202 |
+
<data element_type="u8" shape="0" offset="467405" size="1" />
|
203 |
+
<output>
|
204 |
+
<port id="0" precision="U8">
|
205 |
+
<dim>0</dim>
|
206 |
+
</port>
|
207 |
+
</output>
|
208 |
+
</layer>
|
209 |
+
<layer id="14" name="RegexNormalization_1459358" type="RegexNormalization" version="extension">
|
210 |
+
<data global_replace="true" />
|
211 |
+
<input>
|
212 |
+
<port id="0" precision="I32">
|
213 |
+
<dim>-1</dim>
|
214 |
+
</port>
|
215 |
+
<port id="1" precision="I32">
|
216 |
+
<dim>-1</dim>
|
217 |
+
</port>
|
218 |
+
<port id="2" precision="U8">
|
219 |
+
<dim>-1</dim>
|
220 |
+
</port>
|
221 |
+
<port id="3" precision="U8">
|
222 |
+
<dim>2</dim>
|
223 |
+
</port>
|
224 |
+
<port id="4" precision="U8">
|
225 |
+
<dim>0</dim>
|
226 |
+
</port>
|
227 |
+
</input>
|
228 |
+
<output>
|
229 |
+
<port id="5" precision="I32">
|
230 |
+
<dim>-1</dim>
|
231 |
+
</port>
|
232 |
+
<port id="6" precision="I32">
|
233 |
+
<dim>-1</dim>
|
234 |
+
</port>
|
235 |
+
<port id="7" precision="U8">
|
236 |
+
<dim>-1</dim>
|
237 |
+
</port>
|
238 |
+
</output>
|
239 |
+
</layer>
|
240 |
+
<layer id="15" name="UTF8Validate_1459359" type="UTF8Validate" version="extension">
|
241 |
+
<data replace_mode="true" />
|
242 |
+
<input>
|
243 |
+
<port id="0" precision="I32">
|
244 |
+
<dim>-1</dim>
|
245 |
+
</port>
|
246 |
+
<port id="1" precision="I32">
|
247 |
+
<dim>-1</dim>
|
248 |
+
</port>
|
249 |
+
<port id="2" precision="U8">
|
250 |
+
<dim>-1</dim>
|
251 |
+
</port>
|
252 |
+
</input>
|
253 |
+
<output>
|
254 |
+
<port id="3" precision="I32">
|
255 |
+
<dim>-1</dim>
|
256 |
+
</port>
|
257 |
+
<port id="4" precision="I32">
|
258 |
+
<dim>-1</dim>
|
259 |
+
</port>
|
260 |
+
<port id="5" precision="U8">
|
261 |
+
<dim>-1</dim>
|
262 |
+
</port>
|
263 |
+
</output>
|
264 |
+
</layer>
|
265 |
+
<layer id="16" name="StringTensorPack_1459360" type="StringTensorPack" version="opset15">
|
266 |
+
<input>
|
267 |
+
<port id="0" precision="I32">
|
268 |
+
<dim>-1</dim>
|
269 |
+
</port>
|
270 |
+
<port id="1" precision="I32">
|
271 |
+
<dim>-1</dim>
|
272 |
+
</port>
|
273 |
+
<port id="2" precision="U8">
|
274 |
+
<dim>-1</dim>
|
275 |
+
</port>
|
276 |
+
</input>
|
277 |
+
<output>
|
278 |
+
<port id="3" precision="STRING" names="Result_1459361,string_output">
|
279 |
+
<dim>-1</dim>
|
280 |
+
</port>
|
281 |
+
</output>
|
282 |
+
</layer>
|
283 |
+
<layer id="17" name="Result_1459361" type="Result" version="opset1" output_names="Result_1459361,string_output">
|
284 |
+
<input>
|
285 |
+
<port id="0" precision="STRING">
|
286 |
+
<dim>-1</dim>
|
287 |
+
</port>
|
288 |
+
</input>
|
289 |
+
</layer>
|
290 |
+
</layers>
|
291 |
+
<edges>
|
292 |
+
<edge from-layer="0" from-port="0" to-layer="1" to-port="0" />
|
293 |
+
<edge from-layer="1" from-port="1" to-layer="6" to-port="0" />
|
294 |
+
<edge from-layer="2" from-port="0" to-layer="6" to-port="1" />
|
295 |
+
<edge from-layer="3" from-port="0" to-layer="6" to-port="2" />
|
296 |
+
<edge from-layer="4" from-port="0" to-layer="6" to-port="3" />
|
297 |
+
<edge from-layer="5" from-port="0" to-layer="6" to-port="4" />
|
298 |
+
<edge from-layer="6" from-port="6" to-layer="11" to-port="1" />
|
299 |
+
<edge from-layer="6" from-port="5" to-layer="11" to-port="0" />
|
300 |
+
<edge from-layer="6" from-port="8" to-layer="9" to-port="1" />
|
301 |
+
<edge from-layer="6" from-port="7" to-layer="9" to-port="0" />
|
302 |
+
<edge from-layer="6" from-port="9" to-layer="9" to-port="2" />
|
303 |
+
<edge from-layer="7" from-port="0" to-layer="9" to-port="3" />
|
304 |
+
<edge from-layer="8" from-port="0" to-layer="9" to-port="4" />
|
305 |
+
<edge from-layer="9" from-port="5" to-layer="10" to-port="0" />
|
306 |
+
<edge from-layer="9" from-port="6" to-layer="10" to-port="1" />
|
307 |
+
<edge from-layer="9" from-port="7" to-layer="10" to-port="2" />
|
308 |
+
<edge from-layer="10" from-port="3" to-layer="11" to-port="2" />
|
309 |
+
<edge from-layer="10" from-port="4" to-layer="11" to-port="3" />
|
310 |
+
<edge from-layer="10" from-port="5" to-layer="14" to-port="2" />
|
311 |
+
<edge from-layer="11" from-port="5" to-layer="14" to-port="1" />
|
312 |
+
<edge from-layer="11" from-port="4" to-layer="14" to-port="0" />
|
313 |
+
<edge from-layer="12" from-port="0" to-layer="14" to-port="3" />
|
314 |
+
<edge from-layer="13" from-port="0" to-layer="14" to-port="4" />
|
315 |
+
<edge from-layer="14" from-port="5" to-layer="15" to-port="0" />
|
316 |
+
<edge from-layer="14" from-port="6" to-layer="15" to-port="1" />
|
317 |
+
<edge from-layer="14" from-port="7" to-layer="15" to-port="2" />
|
318 |
+
<edge from-layer="15" from-port="3" to-layer="16" to-port="0" />
|
319 |
+
<edge from-layer="15" from-port="4" to-layer="16" to-port="1" />
|
320 |
+
<edge from-layer="15" from-port="5" to-layer="16" to-port="2" />
|
321 |
+
<edge from-layer="16" from-port="3" to-layer="17" to-port="0" />
|
322 |
+
</edges>
|
323 |
+
<rt_info>
|
324 |
+
<add_attention_mask value="True" />
|
325 |
+
<add_prefix_space />
|
326 |
+
<add_special_tokens value="True" />
|
327 |
+
<bos_token_id value="1" />
|
328 |
+
<chat_template value="{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') %}{{'<|user|>' + ' ' + message['content'] + '<|end|>' + ' ' + '<|assistant|>' + ' '}}{% elif (message['role'] == 'assistant') %}{{message['content'] + '<|end|>' + ' '}}{% endif %}{% endfor %}" />
|
329 |
+
<clean_up_tokenization_spaces />
|
330 |
+
<detokenizer_input_type value="i64" />
|
331 |
+
<eos_token_id value="2" />
|
332 |
+
<handle_special_tokens_with_re />
|
333 |
+
<max_length />
|
334 |
+
<number_of_inputs value="1" />
|
335 |
+
<openvino_tokenizers_version value="2025.2.0.1-567-7885335c24b" />
|
336 |
+
<openvino_version value="2025.2.0-19140-c01cd93e24d-releases/2025/2" />
|
337 |
+
<original_post_processor_template value="{"type": "TemplateProcessing", "single": [{"SpecialToken": {"id": "<s>", "type_id": 0}}, {"Sequence": {"id": "A", "type_id": 0}}], "pair": [{"SpecialToken": {"id": "<s>", "type_id": 0}}, {"Sequence": {"id": "A", "type_id": 0}}, {"SpecialToken": {"id": "<s>", "type_id": 1}}, {"Sequence": {"id": "B", "type_id": 1}}], "special_tokens": {"<s>": {"id": "<s>", "ids": [1], "tokens": ["<s>"]}}}" />
|
338 |
+
<original_tokenizer_class value="<class 'transformers.models.llama.tokenization_llama_fast.LlamaTokenizerFast'>" />
|
339 |
+
<pad_token_id value="2" />
|
340 |
+
<processed_post_processor_template value="{"single": {"ids": [1, -1], "type_ids": [0, 0]}, "pair": {"ids": [1, -1, 1, -2], "type_ids": [0, 0, 1, 1]}}" />
|
341 |
+
<sentencepiece_version value="0.2.1" />
|
342 |
+
<skip_special_tokens value="True" />
|
343 |
+
<streaming_detokenizer value="False" />
|
344 |
+
<tiktoken_version value="0.9.0" />
|
345 |
+
<tokenizer_output_type value="i64" />
|
346 |
+
<tokenizers_version value="0.21.4" />
|
347 |
+
<transformers_version value="4.51.3" />
|
348 |
+
<use_max_padding value="False" />
|
349 |
+
<use_sentencepiece_backend value="False" />
|
350 |
+
<utf8_replace_mode value="replace" />
|
351 |
+
<with_detokenizer value="True" />
|
352 |
+
</rt_info>
|
353 |
+
</net>
|
openvino_language_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9fa4660827c7f09ab7397573ee5f2f5ab795393e507b0467fa9a743fd565fbeb
|
3 |
+
size 1983027502
|
openvino_language_model.xml
ADDED
The diff for this file is too large to render.
See raw diff
|
|
openvino_text_embeddings_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:40e0a8e4a99582fd023cedcc40d684c331496869253f5790636147cd1eda3f3e
|
3 |
+
size 98429484
|
openvino_text_embeddings_model.xml
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<net name="Model3" version="11">
|
3 |
+
<layers>
|
4 |
+
<layer id="0" name="input" type="Parameter" version="opset1">
|
5 |
+
<data shape="?,?" element_type="i64" />
|
6 |
+
<output>
|
7 |
+
<port id="0" precision="I64" names="input">
|
8 |
+
<dim>-1</dim>
|
9 |
+
<dim>-1</dim>
|
10 |
+
</port>
|
11 |
+
</output>
|
12 |
+
</layer>
|
13 |
+
<layer id="1" name="self.weight" type="Const" version="opset1">
|
14 |
+
<data element_type="i8" shape="32020, 3072" offset="0" size="98365440" />
|
15 |
+
<output>
|
16 |
+
<port id="0" precision="I8">
|
17 |
+
<dim>32020</dim>
|
18 |
+
<dim>3072</dim>
|
19 |
+
</port>
|
20 |
+
</output>
|
21 |
+
</layer>
|
22 |
+
<layer id="2" name="Convert_967548" type="Convert" version="opset1">
|
23 |
+
<data destination_type="f16" />
|
24 |
+
<input>
|
25 |
+
<port id="0" precision="I8">
|
26 |
+
<dim>32020</dim>
|
27 |
+
<dim>3072</dim>
|
28 |
+
</port>
|
29 |
+
</input>
|
30 |
+
<output>
|
31 |
+
<port id="1" precision="FP16">
|
32 |
+
<dim>32020</dim>
|
33 |
+
<dim>3072</dim>
|
34 |
+
</port>
|
35 |
+
</output>
|
36 |
+
</layer>
|
37 |
+
<layer id="3" name="self.weight/scale" type="Const" version="opset1">
|
38 |
+
<data element_type="f16" shape="32020, 1" offset="98365440" size="64040" />
|
39 |
+
<output>
|
40 |
+
<port id="0" precision="FP16">
|
41 |
+
<dim>32020</dim>
|
42 |
+
<dim>1</dim>
|
43 |
+
</port>
|
44 |
+
</output>
|
45 |
+
</layer>
|
46 |
+
<layer id="4" name="self.weight/fq_weights_0" type="Multiply" version="opset1">
|
47 |
+
<data auto_broadcast="numpy" />
|
48 |
+
<input>
|
49 |
+
<port id="0" precision="FP16">
|
50 |
+
<dim>32020</dim>
|
51 |
+
<dim>3072</dim>
|
52 |
+
</port>
|
53 |
+
<port id="1" precision="FP16">
|
54 |
+
<dim>32020</dim>
|
55 |
+
<dim>1</dim>
|
56 |
+
</port>
|
57 |
+
</input>
|
58 |
+
<output>
|
59 |
+
<port id="2" precision="FP16">
|
60 |
+
<dim>32020</dim>
|
61 |
+
<dim>3072</dim>
|
62 |
+
</port>
|
63 |
+
</output>
|
64 |
+
</layer>
|
65 |
+
<layer id="5" name="ov_ext::embedding/Convert" type="Convert" version="opset1">
|
66 |
+
<data destination_type="f32" />
|
67 |
+
<rt_info>
|
68 |
+
<attribute name="decompression" version="0" />
|
69 |
+
</rt_info>
|
70 |
+
<input>
|
71 |
+
<port id="0" precision="FP16">
|
72 |
+
<dim>32020</dim>
|
73 |
+
<dim>3072</dim>
|
74 |
+
</port>
|
75 |
+
</input>
|
76 |
+
<output>
|
77 |
+
<port id="1" precision="FP32">
|
78 |
+
<dim>32020</dim>
|
79 |
+
<dim>3072</dim>
|
80 |
+
</port>
|
81 |
+
</output>
|
82 |
+
</layer>
|
83 |
+
<layer id="6" name="ov_ext::embedding/Convert_1" type="Convert" version="opset1">
|
84 |
+
<data destination_type="i32" />
|
85 |
+
<input>
|
86 |
+
<port id="0" precision="I64">
|
87 |
+
<dim>-1</dim>
|
88 |
+
<dim>-1</dim>
|
89 |
+
</port>
|
90 |
+
</input>
|
91 |
+
<output>
|
92 |
+
<port id="1" precision="I32">
|
93 |
+
<dim>-1</dim>
|
94 |
+
<dim>-1</dim>
|
95 |
+
</port>
|
96 |
+
</output>
|
97 |
+
</layer>
|
98 |
+
<layer id="7" name="ov_ext::embedding/Constant" type="Const" version="opset1">
|
99 |
+
<data element_type="i32" shape="" offset="98429480" size="4" />
|
100 |
+
<output>
|
101 |
+
<port id="0" precision="I32" />
|
102 |
+
</output>
|
103 |
+
</layer>
|
104 |
+
<layer id="8" name="ov_ext::embedding/Gather" type="Gather" version="opset8">
|
105 |
+
<data batch_dims="0" />
|
106 |
+
<input>
|
107 |
+
<port id="0" precision="FP32">
|
108 |
+
<dim>32020</dim>
|
109 |
+
<dim>3072</dim>
|
110 |
+
</port>
|
111 |
+
<port id="1" precision="I32">
|
112 |
+
<dim>-1</dim>
|
113 |
+
<dim>-1</dim>
|
114 |
+
</port>
|
115 |
+
<port id="2" precision="I32" />
|
116 |
+
</input>
|
117 |
+
<output>
|
118 |
+
<port id="3" precision="FP32" names="inputs_embeds">
|
119 |
+
<dim>-1</dim>
|
120 |
+
<dim>-1</dim>
|
121 |
+
<dim>3072</dim>
|
122 |
+
</port>
|
123 |
+
</output>
|
124 |
+
</layer>
|
125 |
+
<layer id="9" name="Result_25020" type="Result" version="opset1" output_names="inputs_embeds">
|
126 |
+
<input>
|
127 |
+
<port id="0" precision="FP32">
|
128 |
+
<dim>-1</dim>
|
129 |
+
<dim>-1</dim>
|
130 |
+
<dim>3072</dim>
|
131 |
+
</port>
|
132 |
+
</input>
|
133 |
+
</layer>
|
134 |
+
</layers>
|
135 |
+
<edges>
|
136 |
+
<edge from-layer="0" from-port="0" to-layer="6" to-port="0" />
|
137 |
+
<edge from-layer="1" from-port="0" to-layer="2" to-port="0" />
|
138 |
+
<edge from-layer="2" from-port="1" to-layer="4" to-port="0" />
|
139 |
+
<edge from-layer="3" from-port="0" to-layer="4" to-port="1" />
|
140 |
+
<edge from-layer="4" from-port="2" to-layer="5" to-port="0" />
|
141 |
+
<edge from-layer="5" from-port="1" to-layer="8" to-port="0" />
|
142 |
+
<edge from-layer="6" from-port="1" to-layer="8" to-port="1" />
|
143 |
+
<edge from-layer="7" from-port="0" to-layer="8" to-port="2" />
|
144 |
+
<edge from-layer="8" from-port="3" to-layer="9" to-port="0" />
|
145 |
+
</edges>
|
146 |
+
<rt_info>
|
147 |
+
<Runtime_version value="2025.2.0-19140-c01cd93e24d-releases/2025/2" />
|
148 |
+
<conversion_parameters>
|
149 |
+
<framework value="pytorch" />
|
150 |
+
<is_python_object value="True" />
|
151 |
+
</conversion_parameters>
|
152 |
+
<nncf>
|
153 |
+
<friendly_names_were_updated value="True" />
|
154 |
+
<weight_compression>
|
155 |
+
<advanced_parameters value="{'statistics_path': None, 'awq_params': {'subset_size': 32, 'percent_to_apply': 0.002, 'alpha_min': 0.0, 'alpha_max': 1.0, 'steps': 100}, 'scale_estimation_params': {'subset_size': 64, 'initial_steps': 5, 'scale_steps': 5, 'weight_penalty': -1.0}, 'gptq_params': {'damp_percent': 0.1, 'block_size': 128, 'subset_size': 128}, 'lora_correction_params': {'adapter_rank': 8, 'num_iterations': 3, 'apply_regularization': True, 'subset_size': 128, 'use_int8_adapters': True}}" />
|
156 |
+
<all_layers value="False" />
|
157 |
+
<awq value="False" />
|
158 |
+
<backup_mode value="int8_asym" />
|
159 |
+
<gptq value="False" />
|
160 |
+
<group_size value="-1" />
|
161 |
+
<ignored_scope value="[]" />
|
162 |
+
<lora_correction value="False" />
|
163 |
+
<mode value="int8_sym" />
|
164 |
+
<ratio value="1.0" />
|
165 |
+
<scale_estimation value="False" />
|
166 |
+
<sensitivity_metric value="weight_quantization_error" />
|
167 |
+
</weight_compression>
|
168 |
+
</nncf>
|
169 |
+
<optimum>
|
170 |
+
<nncf_version value="2.15.0" />
|
171 |
+
<optimum_intel_version value="1.26.0.dev0+e9c57b9" />
|
172 |
+
<optimum_version value="1.27.0" />
|
173 |
+
<pytorch_version value="2.8.0+cpu" />
|
174 |
+
<transformers_version value="4.51.3" />
|
175 |
+
</optimum>
|
176 |
+
</rt_info>
|
177 |
+
</net>
|
openvino_tokenizer.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:35f6843829e68542fb7f88d4f4bbd86494ae2165dc972db552b1024a6610c21d
|
3 |
+
size 1882400
|
openvino_tokenizer.xml
ADDED
@@ -0,0 +1,823 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<net name="tokenizer" version="11">
|
3 |
+
<layers>
|
4 |
+
<layer id="0" name="Parameter_1459204" type="Parameter" version="opset1">
|
5 |
+
<data shape="?" element_type="string" />
|
6 |
+
<output>
|
7 |
+
<port id="0" precision="STRING" names="Parameter_1459204">
|
8 |
+
<dim>-1</dim>
|
9 |
+
</port>
|
10 |
+
</output>
|
11 |
+
</layer>
|
12 |
+
<layer id="1" name="Constant_1459323" type="Const" version="opset1">
|
13 |
+
<data element_type="i32" shape="" offset="0" size="4" />
|
14 |
+
<output>
|
15 |
+
<port id="0" precision="I32" />
|
16 |
+
</output>
|
17 |
+
</layer>
|
18 |
+
<layer id="2" name="Constant_1459324" type="Const" version="opset1">
|
19 |
+
<data element_type="i32" shape="" offset="4" size="4" />
|
20 |
+
<output>
|
21 |
+
<port id="0" precision="I32" />
|
22 |
+
</output>
|
23 |
+
</layer>
|
24 |
+
<layer id="3" name="Constant_1459325" type="Const" version="opset1">
|
25 |
+
<data element_type="i32" shape="1" offset="4" size="4" />
|
26 |
+
<output>
|
27 |
+
<port id="0" precision="I32">
|
28 |
+
<dim>1</dim>
|
29 |
+
</port>
|
30 |
+
</output>
|
31 |
+
</layer>
|
32 |
+
<layer id="4" name="Constant_1459210" type="Const" version="opset1">
|
33 |
+
<data element_type="i64" shape="" offset="8" size="8" />
|
34 |
+
<output>
|
35 |
+
<port id="0" precision="I64" />
|
36 |
+
</output>
|
37 |
+
</layer>
|
38 |
+
<layer id="5" name="StringTensorUnpack_1459205" type="StringTensorUnpack" version="opset15">
|
39 |
+
<input>
|
40 |
+
<port id="0" precision="STRING">
|
41 |
+
<dim>-1</dim>
|
42 |
+
</port>
|
43 |
+
</input>
|
44 |
+
<output>
|
45 |
+
<port id="1" precision="I32">
|
46 |
+
<dim>-1</dim>
|
47 |
+
</port>
|
48 |
+
<port id="2" precision="I32">
|
49 |
+
<dim>-1</dim>
|
50 |
+
</port>
|
51 |
+
<port id="3" precision="U8">
|
52 |
+
<dim>-1</dim>
|
53 |
+
</port>
|
54 |
+
</output>
|
55 |
+
</layer>
|
56 |
+
<layer id="6" name="ShapeOf_1459206" type="ShapeOf" version="opset3">
|
57 |
+
<data output_type="i64" />
|
58 |
+
<input>
|
59 |
+
<port id="0" precision="I32">
|
60 |
+
<dim>-1</dim>
|
61 |
+
</port>
|
62 |
+
</input>
|
63 |
+
<output>
|
64 |
+
<port id="1" precision="I64">
|
65 |
+
<dim>1</dim>
|
66 |
+
</port>
|
67 |
+
</output>
|
68 |
+
</layer>
|
69 |
+
<layer id="7" name="Constant_1459207" type="Const" version="opset1">
|
70 |
+
<data element_type="i64" shape="" offset="8" size="8" />
|
71 |
+
<output>
|
72 |
+
<port id="0" precision="I64" />
|
73 |
+
</output>
|
74 |
+
</layer>
|
75 |
+
<layer id="8" name="Constant_1459208" type="Const" version="opset1">
|
76 |
+
<data element_type="i64" shape="" offset="8" size="8" />
|
77 |
+
<output>
|
78 |
+
<port id="0" precision="I64" />
|
79 |
+
</output>
|
80 |
+
</layer>
|
81 |
+
<layer id="9" name="Gather_1459209" type="Gather" version="opset8">
|
82 |
+
<data batch_dims="0" />
|
83 |
+
<input>
|
84 |
+
<port id="0" precision="I64">
|
85 |
+
<dim>1</dim>
|
86 |
+
</port>
|
87 |
+
<port id="1" precision="I64" />
|
88 |
+
<port id="2" precision="I64" />
|
89 |
+
</input>
|
90 |
+
<output>
|
91 |
+
<port id="3" precision="I64" />
|
92 |
+
</output>
|
93 |
+
</layer>
|
94 |
+
<layer id="10" name="Constant_1459211" type="Const" version="opset1">
|
95 |
+
<data element_type="i64" shape="" offset="16" size="8" />
|
96 |
+
<output>
|
97 |
+
<port id="0" precision="I64" />
|
98 |
+
</output>
|
99 |
+
</layer>
|
100 |
+
<layer id="11" name="Range_1459212" type="Range" version="opset4">
|
101 |
+
<data output_type="i32" />
|
102 |
+
<input>
|
103 |
+
<port id="0" precision="I64" />
|
104 |
+
<port id="1" precision="I64" />
|
105 |
+
<port id="2" precision="I64" />
|
106 |
+
</input>
|
107 |
+
<output>
|
108 |
+
<port id="3" precision="I32">
|
109 |
+
<dim>-1</dim>
|
110 |
+
</port>
|
111 |
+
</output>
|
112 |
+
</layer>
|
113 |
+
<layer id="12" name="Constant_1459213" type="Const" version="opset1">
|
114 |
+
<data element_type="i64" shape="" offset="16" size="8" />
|
115 |
+
<output>
|
116 |
+
<port id="0" precision="I64" />
|
117 |
+
</output>
|
118 |
+
</layer>
|
119 |
+
<layer id="13" name="Constant_1459214" type="Const" version="opset1">
|
120 |
+
<data element_type="i64" shape="" offset="16" size="8" />
|
121 |
+
<output>
|
122 |
+
<port id="0" precision="I64" />
|
123 |
+
</output>
|
124 |
+
</layer>
|
125 |
+
<layer id="14" name="Add_1459215" type="Add" version="opset1">
|
126 |
+
<data auto_broadcast="numpy" />
|
127 |
+
<input>
|
128 |
+
<port id="0" precision="I64" />
|
129 |
+
<port id="1" precision="I64" />
|
130 |
+
</input>
|
131 |
+
<output>
|
132 |
+
<port id="2" precision="I64" />
|
133 |
+
</output>
|
134 |
+
</layer>
|
135 |
+
<layer id="15" name="Constant_1459216" type="Const" version="opset1">
|
136 |
+
<data element_type="i64" shape="" offset="16" size="8" />
|
137 |
+
<output>
|
138 |
+
<port id="0" precision="I64" />
|
139 |
+
</output>
|
140 |
+
</layer>
|
141 |
+
<layer id="16" name="Range_1459217" type="Range" version="opset4">
|
142 |
+
<data output_type="i32" />
|
143 |
+
<input>
|
144 |
+
<port id="0" precision="I64" />
|
145 |
+
<port id="1" precision="I64" />
|
146 |
+
<port id="2" precision="I64" />
|
147 |
+
</input>
|
148 |
+
<output>
|
149 |
+
<port id="3" precision="I32">
|
150 |
+
<dim>-1</dim>
|
151 |
+
</port>
|
152 |
+
</output>
|
153 |
+
</layer>
|
154 |
+
<layer id="17" name="Constant_1459279" type="Const" version="opset1">
|
155 |
+
<data element_type="u8" shape="436" offset="24" size="436" />
|
156 |
+
<output>
|
157 |
+
<port id="0" precision="U8">
|
158 |
+
<dim>436</dim>
|
159 |
+
</port>
|
160 |
+
</output>
|
161 |
+
</layer>
|
162 |
+
<layer id="18" name="SpecialTokensSplit_1459280" type="SpecialTokensSplit" version="extension">
|
163 |
+
<input>
|
164 |
+
<port id="0" precision="I32">
|
165 |
+
<dim>-1</dim>
|
166 |
+
</port>
|
167 |
+
<port id="1" precision="I32">
|
168 |
+
<dim>-1</dim>
|
169 |
+
</port>
|
170 |
+
<port id="2" precision="I32">
|
171 |
+
<dim>-1</dim>
|
172 |
+
</port>
|
173 |
+
<port id="3" precision="I32">
|
174 |
+
<dim>-1</dim>
|
175 |
+
</port>
|
176 |
+
<port id="4" precision="U8">
|
177 |
+
<dim>-1</dim>
|
178 |
+
</port>
|
179 |
+
<port id="5" precision="U8">
|
180 |
+
<dim>436</dim>
|
181 |
+
</port>
|
182 |
+
</input>
|
183 |
+
<output>
|
184 |
+
<port id="6" precision="I32">
|
185 |
+
<dim>-1</dim>
|
186 |
+
</port>
|
187 |
+
<port id="7" precision="I32">
|
188 |
+
<dim>-1</dim>
|
189 |
+
</port>
|
190 |
+
<port id="8" precision="I32">
|
191 |
+
<dim>-1</dim>
|
192 |
+
</port>
|
193 |
+
<port id="9" precision="I32">
|
194 |
+
<dim>-1</dim>
|
195 |
+
</port>
|
196 |
+
<port id="10" precision="U8">
|
197 |
+
<dim>-1</dim>
|
198 |
+
</port>
|
199 |
+
<port id="11" precision="BOOL">
|
200 |
+
<dim>-1</dim>
|
201 |
+
</port>
|
202 |
+
</output>
|
203 |
+
</layer>
|
204 |
+
<layer id="19" name="Constant_1459282" type="Const" version="opset1">
|
205 |
+
<data element_type="u8" shape="1" offset="460" size="1" />
|
206 |
+
<output>
|
207 |
+
<port id="0" precision="U8">
|
208 |
+
<dim>1</dim>
|
209 |
+
</port>
|
210 |
+
</output>
|
211 |
+
</layer>
|
212 |
+
<layer id="20" name="Constant_1459284" type="Const" version="opset1">
|
213 |
+
<data element_type="u8" shape="3" offset="461" size="3" />
|
214 |
+
<output>
|
215 |
+
<port id="0" precision="U8">
|
216 |
+
<dim>3</dim>
|
217 |
+
</port>
|
218 |
+
</output>
|
219 |
+
</layer>
|
220 |
+
<layer id="21" name="RegexNormalization_1459285" type="RegexNormalization" version="extension">
|
221 |
+
<data global_replace="true" />
|
222 |
+
<input>
|
223 |
+
<port id="0" precision="I32">
|
224 |
+
<dim>-1</dim>
|
225 |
+
</port>
|
226 |
+
<port id="1" precision="I32">
|
227 |
+
<dim>-1</dim>
|
228 |
+
</port>
|
229 |
+
<port id="2" precision="U8">
|
230 |
+
<dim>-1</dim>
|
231 |
+
</port>
|
232 |
+
<port id="3" precision="BOOL">
|
233 |
+
<dim>-1</dim>
|
234 |
+
</port>
|
235 |
+
<port id="4" precision="U8">
|
236 |
+
<dim>1</dim>
|
237 |
+
</port>
|
238 |
+
<port id="5" precision="U8">
|
239 |
+
<dim>3</dim>
|
240 |
+
</port>
|
241 |
+
</input>
|
242 |
+
<output>
|
243 |
+
<port id="6" precision="I32">
|
244 |
+
<dim>-1</dim>
|
245 |
+
</port>
|
246 |
+
<port id="7" precision="I32">
|
247 |
+
<dim>-1</dim>
|
248 |
+
</port>
|
249 |
+
<port id="8" precision="U8">
|
250 |
+
<dim>-1</dim>
|
251 |
+
</port>
|
252 |
+
<port id="9" precision="BOOL">
|
253 |
+
<dim>-1</dim>
|
254 |
+
</port>
|
255 |
+
</output>
|
256 |
+
</layer>
|
257 |
+
<layer id="22" name="Constant_1459287" type="Const" version="opset1">
|
258 |
+
<data element_type="u8" shape="11" offset="464" size="11" />
|
259 |
+
<output>
|
260 |
+
<port id="0" precision="U8">
|
261 |
+
<dim>11</dim>
|
262 |
+
</port>
|
263 |
+
</output>
|
264 |
+
</layer>
|
265 |
+
<layer id="23" name="Constant_1459289" type="Const" version="opset1">
|
266 |
+
<data element_type="u8" shape="5" offset="475" size="5" />
|
267 |
+
<output>
|
268 |
+
<port id="0" precision="U8">
|
269 |
+
<dim>5</dim>
|
270 |
+
</port>
|
271 |
+
</output>
|
272 |
+
</layer>
|
273 |
+
<layer id="24" name="RegexNormalization_1459290" type="RegexNormalization" version="extension">
|
274 |
+
<data global_replace="true" />
|
275 |
+
<input>
|
276 |
+
<port id="0" precision="I32">
|
277 |
+
<dim>-1</dim>
|
278 |
+
</port>
|
279 |
+
<port id="1" precision="I32">
|
280 |
+
<dim>-1</dim>
|
281 |
+
</port>
|
282 |
+
<port id="2" precision="U8">
|
283 |
+
<dim>-1</dim>
|
284 |
+
</port>
|
285 |
+
<port id="3" precision="BOOL">
|
286 |
+
<dim>-1</dim>
|
287 |
+
</port>
|
288 |
+
<port id="4" precision="U8">
|
289 |
+
<dim>11</dim>
|
290 |
+
</port>
|
291 |
+
<port id="5" precision="U8">
|
292 |
+
<dim>5</dim>
|
293 |
+
</port>
|
294 |
+
</input>
|
295 |
+
<output>
|
296 |
+
<port id="6" precision="I32">
|
297 |
+
<dim>-1</dim>
|
298 |
+
</port>
|
299 |
+
<port id="7" precision="I32">
|
300 |
+
<dim>-1</dim>
|
301 |
+
</port>
|
302 |
+
<port id="8" precision="U8">
|
303 |
+
<dim>-1</dim>
|
304 |
+
</port>
|
305 |
+
<port id="9" precision="BOOL">
|
306 |
+
<dim>-1</dim>
|
307 |
+
</port>
|
308 |
+
</output>
|
309 |
+
</layer>
|
310 |
+
<layer id="25" name="Constant_1459292" type="Const" version="opset1">
|
311 |
+
<data element_type="i32" shape="32020" offset="480" size="128080" />
|
312 |
+
<output>
|
313 |
+
<port id="0" precision="I32">
|
314 |
+
<dim>32020</dim>
|
315 |
+
</port>
|
316 |
+
</output>
|
317 |
+
</layer>
|
318 |
+
<layer id="26" name="Constant_1459294" type="Const" version="opset1">
|
319 |
+
<data element_type="i32" shape="32020" offset="128560" size="128080" />
|
320 |
+
<output>
|
321 |
+
<port id="0" precision="I32">
|
322 |
+
<dim>32020</dim>
|
323 |
+
</port>
|
324 |
+
</output>
|
325 |
+
</layer>
|
326 |
+
<layer id="27" name="Constant_1459296" type="Const" version="opset1">
|
327 |
+
<data element_type="u8" shape="211147" offset="256640" size="211147" />
|
328 |
+
<output>
|
329 |
+
<port id="0" precision="U8">
|
330 |
+
<dim>211147</dim>
|
331 |
+
</port>
|
332 |
+
</output>
|
333 |
+
</layer>
|
334 |
+
<layer id="28" name="Constant_1459304" type="Const" version="opset1">
|
335 |
+
<data element_type="i32" shape="61249" offset="467787" size="244996" />
|
336 |
+
<output>
|
337 |
+
<port id="0" precision="I32">
|
338 |
+
<dim>61249</dim>
|
339 |
+
</port>
|
340 |
+
</output>
|
341 |
+
</layer>
|
342 |
+
<layer id="29" name="Constant_1459306" type="Const" version="opset1">
|
343 |
+
<data element_type="i32" shape="61249" offset="712783" size="244996" />
|
344 |
+
<output>
|
345 |
+
<port id="0" precision="I32">
|
346 |
+
<dim>61249</dim>
|
347 |
+
</port>
|
348 |
+
</output>
|
349 |
+
</layer>
|
350 |
+
<layer id="30" name="Constant_1459308" type="Const" version="opset1">
|
351 |
+
<data element_type="u8" shape="254123" offset="957779" size="254123" />
|
352 |
+
<output>
|
353 |
+
<port id="0" precision="U8">
|
354 |
+
<dim>254123</dim>
|
355 |
+
</port>
|
356 |
+
</output>
|
357 |
+
</layer>
|
358 |
+
<layer id="31" name="Constant_1459310" type="Const" version="opset1">
|
359 |
+
<data element_type="i32" shape="61249" offset="1211902" size="244996" />
|
360 |
+
<output>
|
361 |
+
<port id="0" precision="I32">
|
362 |
+
<dim>61249</dim>
|
363 |
+
</port>
|
364 |
+
</output>
|
365 |
+
</layer>
|
366 |
+
<layer id="32" name="Constant_1459312" type="Const" version="opset1">
|
367 |
+
<data element_type="i32" shape="61249" offset="1456898" size="244996" />
|
368 |
+
<output>
|
369 |
+
<port id="0" precision="I32">
|
370 |
+
<dim>61249</dim>
|
371 |
+
</port>
|
372 |
+
</output>
|
373 |
+
</layer>
|
374 |
+
<layer id="33" name="Constant_1459314" type="Const" version="opset1">
|
375 |
+
<data element_type="u8" shape="167806" offset="1701894" size="167806" />
|
376 |
+
<output>
|
377 |
+
<port id="0" precision="U8">
|
378 |
+
<dim>167806</dim>
|
379 |
+
</port>
|
380 |
+
</output>
|
381 |
+
</layer>
|
382 |
+
<layer id="34" name="Constant_1459298" type="Const" version="opset1">
|
383 |
+
<data element_type="i32" shape="484" offset="1869700" size="1936" />
|
384 |
+
<output>
|
385 |
+
<port id="0" precision="I32">
|
386 |
+
<dim>484</dim>
|
387 |
+
</port>
|
388 |
+
</output>
|
389 |
+
</layer>
|
390 |
+
<layer id="35" name="Constant_1459300" type="Const" version="opset1">
|
391 |
+
<data element_type="i32" shape="484" offset="1871636" size="1936" />
|
392 |
+
<output>
|
393 |
+
<port id="0" precision="I32">
|
394 |
+
<dim>484</dim>
|
395 |
+
</port>
|
396 |
+
</output>
|
397 |
+
</layer>
|
398 |
+
<layer id="36" name="Constant_1459302" type="Const" version="opset1">
|
399 |
+
<data element_type="u8" shape="6867" offset="1873572" size="6867" />
|
400 |
+
<output>
|
401 |
+
<port id="0" precision="U8">
|
402 |
+
<dim>6867</dim>
|
403 |
+
</port>
|
404 |
+
</output>
|
405 |
+
</layer>
|
406 |
+
<layer id="37" name="Constant_1459315" type="Const" version="opset1">
|
407 |
+
<data element_type="i32" shape="484" offset="1880439" size="1936" />
|
408 |
+
<output>
|
409 |
+
<port id="0" precision="I32">
|
410 |
+
<dim>484</dim>
|
411 |
+
</port>
|
412 |
+
</output>
|
413 |
+
</layer>
|
414 |
+
<layer id="38" name="BPETokenizer_1459316" type="BPETokenizer" version="extension">
|
415 |
+
<data unk_token="<unk>" fuse_unk="true" suffix_indicator="" end_suffix="" byte_fallback="true" cache_capacity="20000" />
|
416 |
+
<input>
|
417 |
+
<port id="0" precision="I32">
|
418 |
+
<dim>-1</dim>
|
419 |
+
</port>
|
420 |
+
<port id="1" precision="I32">
|
421 |
+
<dim>-1</dim>
|
422 |
+
</port>
|
423 |
+
<port id="2" precision="I32">
|
424 |
+
<dim>-1</dim>
|
425 |
+
</port>
|
426 |
+
<port id="3" precision="I32">
|
427 |
+
<dim>-1</dim>
|
428 |
+
</port>
|
429 |
+
<port id="4" precision="U8">
|
430 |
+
<dim>-1</dim>
|
431 |
+
</port>
|
432 |
+
<port id="5" precision="I32">
|
433 |
+
<dim>32020</dim>
|
434 |
+
</port>
|
435 |
+
<port id="6" precision="I32">
|
436 |
+
<dim>32020</dim>
|
437 |
+
</port>
|
438 |
+
<port id="7" precision="U8">
|
439 |
+
<dim>211147</dim>
|
440 |
+
</port>
|
441 |
+
<port id="8" precision="I32">
|
442 |
+
<dim>61249</dim>
|
443 |
+
</port>
|
444 |
+
<port id="9" precision="I32">
|
445 |
+
<dim>61249</dim>
|
446 |
+
</port>
|
447 |
+
<port id="10" precision="U8">
|
448 |
+
<dim>254123</dim>
|
449 |
+
</port>
|
450 |
+
<port id="11" precision="I32">
|
451 |
+
<dim>61249</dim>
|
452 |
+
</port>
|
453 |
+
<port id="12" precision="I32">
|
454 |
+
<dim>61249</dim>
|
455 |
+
</port>
|
456 |
+
<port id="13" precision="U8">
|
457 |
+
<dim>167806</dim>
|
458 |
+
</port>
|
459 |
+
<port id="14" precision="I32">
|
460 |
+
<dim>484</dim>
|
461 |
+
</port>
|
462 |
+
<port id="15" precision="I32">
|
463 |
+
<dim>484</dim>
|
464 |
+
</port>
|
465 |
+
<port id="16" precision="U8">
|
466 |
+
<dim>6867</dim>
|
467 |
+
</port>
|
468 |
+
<port id="17" precision="I32">
|
469 |
+
<dim>484</dim>
|
470 |
+
</port>
|
471 |
+
</input>
|
472 |
+
<output>
|
473 |
+
<port id="18" precision="I32">
|
474 |
+
<dim>-1</dim>
|
475 |
+
</port>
|
476 |
+
<port id="19" precision="I32">
|
477 |
+
<dim>-1</dim>
|
478 |
+
</port>
|
479 |
+
<port id="20" precision="I32">
|
480 |
+
<dim>-1</dim>
|
481 |
+
</port>
|
482 |
+
</output>
|
483 |
+
</layer>
|
484 |
+
<layer id="39" name="Constant_1459317" type="Const" version="opset1">
|
485 |
+
<data element_type="i32" shape="" offset="1882375" size="4" />
|
486 |
+
<output>
|
487 |
+
<port id="0" precision="I32" />
|
488 |
+
</output>
|
489 |
+
</layer>
|
490 |
+
<layer id="40" name="Constant_1459319" type="Const" version="opset1">
|
491 |
+
<data element_type="u8" shape="4" offset="1882379" size="4" />
|
492 |
+
<output>
|
493 |
+
<port id="0" precision="U8">
|
494 |
+
<dim>4</dim>
|
495 |
+
</port>
|
496 |
+
</output>
|
497 |
+
</layer>
|
498 |
+
<layer id="41" name="Constant_1459321" type="Const" version="opset1">
|
499 |
+
<data element_type="u8" shape="13" offset="1882383" size="13" />
|
500 |
+
<output>
|
501 |
+
<port id="0" precision="U8">
|
502 |
+
<dim>13</dim>
|
503 |
+
</port>
|
504 |
+
</output>
|
505 |
+
</layer>
|
506 |
+
<layer id="42" name="Truncate_1459322" type="Truncate" version="extension">
|
507 |
+
<data m_num_inputs="1" />
|
508 |
+
<input>
|
509 |
+
<port id="0" precision="I32">
|
510 |
+
<dim>-1</dim>
|
511 |
+
</port>
|
512 |
+
<port id="1" precision="I32">
|
513 |
+
<dim>-1</dim>
|
514 |
+
</port>
|
515 |
+
<port id="2" precision="I32">
|
516 |
+
<dim>-1</dim>
|
517 |
+
</port>
|
518 |
+
<port id="3" precision="I32" />
|
519 |
+
<port id="4" precision="U8">
|
520 |
+
<dim>4</dim>
|
521 |
+
</port>
|
522 |
+
<port id="5" precision="U8">
|
523 |
+
<dim>13</dim>
|
524 |
+
</port>
|
525 |
+
</input>
|
526 |
+
<output>
|
527 |
+
<port id="6" precision="I32">
|
528 |
+
<dim>-1</dim>
|
529 |
+
</port>
|
530 |
+
<port id="7" precision="I32">
|
531 |
+
<dim>-1</dim>
|
532 |
+
</port>
|
533 |
+
<port id="8" precision="I32">
|
534 |
+
<dim>-1</dim>
|
535 |
+
</port>
|
536 |
+
</output>
|
537 |
+
</layer>
|
538 |
+
<layer id="43" name="Constant_1459326" type="Const" version="opset1">
|
539 |
+
<data element_type="i32" shape="2" offset="8" size="8" />
|
540 |
+
<output>
|
541 |
+
<port id="0" precision="I32">
|
542 |
+
<dim>2</dim>
|
543 |
+
</port>
|
544 |
+
</output>
|
545 |
+
</layer>
|
546 |
+
<layer id="44" name="CombineSegments_1459327" type="CombineSegments" version="extension">
|
547 |
+
<input>
|
548 |
+
<port id="0" precision="I32" />
|
549 |
+
<port id="1" precision="I32" />
|
550 |
+
<port id="2" precision="I32">
|
551 |
+
<dim>1</dim>
|
552 |
+
</port>
|
553 |
+
<port id="3" precision="I32">
|
554 |
+
<dim>-1</dim>
|
555 |
+
</port>
|
556 |
+
<port id="4" precision="I32">
|
557 |
+
<dim>-1</dim>
|
558 |
+
</port>
|
559 |
+
<port id="5" precision="I32">
|
560 |
+
<dim>-1</dim>
|
561 |
+
</port>
|
562 |
+
<port id="6" precision="I32">
|
563 |
+
<dim>2</dim>
|
564 |
+
</port>
|
565 |
+
</input>
|
566 |
+
<output>
|
567 |
+
<port id="7" precision="I32">
|
568 |
+
<dim>-1</dim>
|
569 |
+
</port>
|
570 |
+
<port id="8" precision="I32">
|
571 |
+
<dim>-1</dim>
|
572 |
+
</port>
|
573 |
+
<port id="9" precision="I32">
|
574 |
+
<dim>-1</dim>
|
575 |
+
</port>
|
576 |
+
<port id="10" precision="I32">
|
577 |
+
<dim>-1</dim>
|
578 |
+
</port>
|
579 |
+
<port id="11" precision="I32">
|
580 |
+
<dim>-1</dim>
|
581 |
+
</port>
|
582 |
+
<port id="12" precision="I32">
|
583 |
+
<dim>-1</dim>
|
584 |
+
</port>
|
585 |
+
</output>
|
586 |
+
</layer>
|
587 |
+
<layer id="45" name="Subtract_1459328" type="Subtract" version="opset1">
|
588 |
+
<data auto_broadcast="numpy" />
|
589 |
+
<input>
|
590 |
+
<port id="0" precision="I32">
|
591 |
+
<dim>-1</dim>
|
592 |
+
</port>
|
593 |
+
<port id="1" precision="I32">
|
594 |
+
<dim>-1</dim>
|
595 |
+
</port>
|
596 |
+
</input>
|
597 |
+
<output>
|
598 |
+
<port id="2" precision="I32">
|
599 |
+
<dim>-1</dim>
|
600 |
+
</port>
|
601 |
+
</output>
|
602 |
+
</layer>
|
603 |
+
<layer id="46" name="Constant_1459329" type="Const" version="opset1">
|
604 |
+
<data element_type="i32" shape="" offset="0" size="4" />
|
605 |
+
<output>
|
606 |
+
<port id="0" precision="I32" />
|
607 |
+
</output>
|
608 |
+
</layer>
|
609 |
+
<layer id="47" name="ReduceMax_1459330" type="ReduceMax" version="opset1">
|
610 |
+
<data keep_dims="false" />
|
611 |
+
<input>
|
612 |
+
<port id="0" precision="I32">
|
613 |
+
<dim>-1</dim>
|
614 |
+
</port>
|
615 |
+
<port id="1" precision="I32" />
|
616 |
+
</input>
|
617 |
+
<output>
|
618 |
+
<port id="2" precision="I32" />
|
619 |
+
</output>
|
620 |
+
</layer>
|
621 |
+
<layer id="48" name="Constant_1459331" type="Const" version="opset1">
|
622 |
+
<data element_type="i32" shape="" offset="1882396" size="4" />
|
623 |
+
<output>
|
624 |
+
<port id="0" precision="I32" />
|
625 |
+
</output>
|
626 |
+
</layer>
|
627 |
+
<layer id="49" name="RaggedToDense_1459332" type="RaggedToDense" version="extension">
|
628 |
+
<data pad_right="false" m_pad_max_length="false" />
|
629 |
+
<input>
|
630 |
+
<port id="0" precision="I32">
|
631 |
+
<dim>-1</dim>
|
632 |
+
</port>
|
633 |
+
<port id="1" precision="I32">
|
634 |
+
<dim>-1</dim>
|
635 |
+
</port>
|
636 |
+
<port id="2" precision="I32">
|
637 |
+
<dim>-1</dim>
|
638 |
+
</port>
|
639 |
+
<port id="3" precision="I32" />
|
640 |
+
<port id="4" precision="I32" />
|
641 |
+
</input>
|
642 |
+
<output>
|
643 |
+
<port id="5" precision="I32">
|
644 |
+
<dim>-1</dim>
|
645 |
+
<dim>-1</dim>
|
646 |
+
</port>
|
647 |
+
<port id="6" precision="BOOL">
|
648 |
+
<dim>-1</dim>
|
649 |
+
<dim>-1</dim>
|
650 |
+
</port>
|
651 |
+
</output>
|
652 |
+
</layer>
|
653 |
+
<layer id="50" name="Convert_1459333" type="Convert" version="opset1">
|
654 |
+
<data destination_type="i32" />
|
655 |
+
<input>
|
656 |
+
<port id="0" precision="BOOL">
|
657 |
+
<dim>-1</dim>
|
658 |
+
<dim>-1</dim>
|
659 |
+
</port>
|
660 |
+
</input>
|
661 |
+
<output>
|
662 |
+
<port id="1" precision="I32">
|
663 |
+
<dim>-1</dim>
|
664 |
+
<dim>-1</dim>
|
665 |
+
</port>
|
666 |
+
</output>
|
667 |
+
</layer>
|
668 |
+
<layer id="51" name="Convert_1459333.0" type="Convert" version="opset1">
|
669 |
+
<data destination_type="i64" />
|
670 |
+
<input>
|
671 |
+
<port id="0" precision="I32">
|
672 |
+
<dim>-1</dim>
|
673 |
+
<dim>-1</dim>
|
674 |
+
</port>
|
675 |
+
</input>
|
676 |
+
<output>
|
677 |
+
<port id="1" precision="I64" names="attention_mask">
|
678 |
+
<dim>-1</dim>
|
679 |
+
<dim>-1</dim>
|
680 |
+
</port>
|
681 |
+
</output>
|
682 |
+
</layer>
|
683 |
+
<layer id="53" name="RaggedToDense_1459332.0" type="Convert" version="opset1">
|
684 |
+
<data destination_type="i64" />
|
685 |
+
<input>
|
686 |
+
<port id="0" precision="I32">
|
687 |
+
<dim>-1</dim>
|
688 |
+
<dim>-1</dim>
|
689 |
+
</port>
|
690 |
+
</input>
|
691 |
+
<output>
|
692 |
+
<port id="1" precision="I64" names="input_ids">
|
693 |
+
<dim>-1</dim>
|
694 |
+
<dim>-1</dim>
|
695 |
+
</port>
|
696 |
+
</output>
|
697 |
+
</layer>
|
698 |
+
<layer id="54" name="Result_1459336" type="Result" version="opset1" output_names="input_ids">
|
699 |
+
<input>
|
700 |
+
<port id="0" precision="I64">
|
701 |
+
<dim>-1</dim>
|
702 |
+
<dim>-1</dim>
|
703 |
+
</port>
|
704 |
+
</input>
|
705 |
+
</layer>
|
706 |
+
<layer id="52" name="Result_1459338" type="Result" version="opset1" output_names="attention_mask">
|
707 |
+
<input>
|
708 |
+
<port id="0" precision="I64">
|
709 |
+
<dim>-1</dim>
|
710 |
+
<dim>-1</dim>
|
711 |
+
</port>
|
712 |
+
</input>
|
713 |
+
</layer>
|
714 |
+
</layers>
|
715 |
+
<edges>
|
716 |
+
<edge from-layer="0" from-port="0" to-layer="5" to-port="0" />
|
717 |
+
<edge from-layer="1" from-port="0" to-layer="44" to-port="0" />
|
718 |
+
<edge from-layer="2" from-port="0" to-layer="44" to-port="1" />
|
719 |
+
<edge from-layer="3" from-port="0" to-layer="44" to-port="2" />
|
720 |
+
<edge from-layer="4" from-port="0" to-layer="11" to-port="0" />
|
721 |
+
<edge from-layer="5" from-port="1" to-layer="6" to-port="0" />
|
722 |
+
<edge from-layer="5" from-port="3" to-layer="18" to-port="4" />
|
723 |
+
<edge from-layer="5" from-port="2" to-layer="18" to-port="3" />
|
724 |
+
<edge from-layer="5" from-port="1" to-layer="18" to-port="2" />
|
725 |
+
<edge from-layer="6" from-port="1" to-layer="9" to-port="0" />
|
726 |
+
<edge from-layer="7" from-port="0" to-layer="9" to-port="1" />
|
727 |
+
<edge from-layer="8" from-port="0" to-layer="9" to-port="2" />
|
728 |
+
<edge from-layer="9" from-port="3" to-layer="14" to-port="0" />
|
729 |
+
<edge from-layer="9" from-port="3" to-layer="11" to-port="1" />
|
730 |
+
<edge from-layer="10" from-port="0" to-layer="11" to-port="2" />
|
731 |
+
<edge from-layer="11" from-port="3" to-layer="18" to-port="0" />
|
732 |
+
<edge from-layer="12" from-port="0" to-layer="16" to-port="0" />
|
733 |
+
<edge from-layer="13" from-port="0" to-layer="14" to-port="1" />
|
734 |
+
<edge from-layer="14" from-port="2" to-layer="16" to-port="1" />
|
735 |
+
<edge from-layer="15" from-port="0" to-layer="16" to-port="2" />
|
736 |
+
<edge from-layer="16" from-port="3" to-layer="18" to-port="1" />
|
737 |
+
<edge from-layer="17" from-port="0" to-layer="18" to-port="5" />
|
738 |
+
<edge from-layer="18" from-port="6" to-layer="38" to-port="0" />
|
739 |
+
<edge from-layer="18" from-port="7" to-layer="38" to-port="1" />
|
740 |
+
<edge from-layer="18" from-port="11" to-layer="21" to-port="3" />
|
741 |
+
<edge from-layer="18" from-port="10" to-layer="21" to-port="2" />
|
742 |
+
<edge from-layer="18" from-port="9" to-layer="21" to-port="1" />
|
743 |
+
<edge from-layer="18" from-port="8" to-layer="21" to-port="0" />
|
744 |
+
<edge from-layer="19" from-port="0" to-layer="21" to-port="4" />
|
745 |
+
<edge from-layer="20" from-port="0" to-layer="21" to-port="5" />
|
746 |
+
<edge from-layer="21" from-port="6" to-layer="24" to-port="0" />
|
747 |
+
<edge from-layer="21" from-port="9" to-layer="24" to-port="3" />
|
748 |
+
<edge from-layer="21" from-port="8" to-layer="24" to-port="2" />
|
749 |
+
<edge from-layer="21" from-port="7" to-layer="24" to-port="1" />
|
750 |
+
<edge from-layer="22" from-port="0" to-layer="24" to-port="4" />
|
751 |
+
<edge from-layer="23" from-port="0" to-layer="24" to-port="5" />
|
752 |
+
<edge from-layer="24" from-port="6" to-layer="38" to-port="2" />
|
753 |
+
<edge from-layer="24" from-port="7" to-layer="38" to-port="3" />
|
754 |
+
<edge from-layer="24" from-port="8" to-layer="38" to-port="4" />
|
755 |
+
<edge from-layer="25" from-port="0" to-layer="38" to-port="5" />
|
756 |
+
<edge from-layer="26" from-port="0" to-layer="38" to-port="6" />
|
757 |
+
<edge from-layer="27" from-port="0" to-layer="38" to-port="7" />
|
758 |
+
<edge from-layer="28" from-port="0" to-layer="38" to-port="8" />
|
759 |
+
<edge from-layer="29" from-port="0" to-layer="38" to-port="9" />
|
760 |
+
<edge from-layer="30" from-port="0" to-layer="38" to-port="10" />
|
761 |
+
<edge from-layer="31" from-port="0" to-layer="38" to-port="11" />
|
762 |
+
<edge from-layer="32" from-port="0" to-layer="38" to-port="12" />
|
763 |
+
<edge from-layer="33" from-port="0" to-layer="38" to-port="13" />
|
764 |
+
<edge from-layer="34" from-port="0" to-layer="38" to-port="14" />
|
765 |
+
<edge from-layer="35" from-port="0" to-layer="38" to-port="15" />
|
766 |
+
<edge from-layer="36" from-port="0" to-layer="38" to-port="16" />
|
767 |
+
<edge from-layer="37" from-port="0" to-layer="38" to-port="17" />
|
768 |
+
<edge from-layer="38" from-port="18" to-layer="42" to-port="0" />
|
769 |
+
<edge from-layer="38" from-port="19" to-layer="42" to-port="1" />
|
770 |
+
<edge from-layer="38" from-port="20" to-layer="42" to-port="2" />
|
771 |
+
<edge from-layer="39" from-port="0" to-layer="42" to-port="3" />
|
772 |
+
<edge from-layer="40" from-port="0" to-layer="42" to-port="4" />
|
773 |
+
<edge from-layer="41" from-port="0" to-layer="42" to-port="5" />
|
774 |
+
<edge from-layer="42" from-port="8" to-layer="44" to-port="5" />
|
775 |
+
<edge from-layer="42" from-port="7" to-layer="44" to-port="4" />
|
776 |
+
<edge from-layer="42" from-port="6" to-layer="44" to-port="3" />
|
777 |
+
<edge from-layer="43" from-port="0" to-layer="44" to-port="6" />
|
778 |
+
<edge from-layer="44" from-port="8" to-layer="45" to-port="0" />
|
779 |
+
<edge from-layer="44" from-port="7" to-layer="45" to-port="1" />
|
780 |
+
<edge from-layer="44" from-port="7" to-layer="49" to-port="0" />
|
781 |
+
<edge from-layer="44" from-port="8" to-layer="49" to-port="1" />
|
782 |
+
<edge from-layer="44" from-port="9" to-layer="49" to-port="2" />
|
783 |
+
<edge from-layer="45" from-port="2" to-layer="47" to-port="0" />
|
784 |
+
<edge from-layer="46" from-port="0" to-layer="47" to-port="1" />
|
785 |
+
<edge from-layer="47" from-port="2" to-layer="49" to-port="3" />
|
786 |
+
<edge from-layer="48" from-port="0" to-layer="49" to-port="4" />
|
787 |
+
<edge from-layer="49" from-port="6" to-layer="50" to-port="0" />
|
788 |
+
<edge from-layer="49" from-port="5" to-layer="53" to-port="0" />
|
789 |
+
<edge from-layer="50" from-port="1" to-layer="51" to-port="0" />
|
790 |
+
<edge from-layer="51" from-port="1" to-layer="52" to-port="0" />
|
791 |
+
<edge from-layer="53" from-port="1" to-layer="54" to-port="0" />
|
792 |
+
</edges>
|
793 |
+
<rt_info>
|
794 |
+
<add_attention_mask value="True" />
|
795 |
+
<add_prefix_space />
|
796 |
+
<add_special_tokens value="True" />
|
797 |
+
<bos_token_id value="1" />
|
798 |
+
<chat_template value="{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') %}{{'<|user|>' + ' ' + message['content'] + '<|end|>' + ' ' + '<|assistant|>' + ' '}}{% elif (message['role'] == 'assistant') %}{{message['content'] + '<|end|>' + ' '}}{% endif %}{% endfor %}" />
|
799 |
+
<clean_up_tokenization_spaces />
|
800 |
+
<detokenizer_input_type value="i64" />
|
801 |
+
<eos_token_id value="2" />
|
802 |
+
<handle_special_tokens_with_re />
|
803 |
+
<max_length />
|
804 |
+
<number_of_inputs value="1" />
|
805 |
+
<openvino_tokenizers_version value="2025.2.0.1-567-7885335c24b" />
|
806 |
+
<openvino_version value="2025.2.0-19140-c01cd93e24d-releases/2025/2" />
|
807 |
+
<original_post_processor_template value="{"type": "TemplateProcessing", "single": [{"SpecialToken": {"id": "<s>", "type_id": 0}}, {"Sequence": {"id": "A", "type_id": 0}}], "pair": [{"SpecialToken": {"id": "<s>", "type_id": 0}}, {"Sequence": {"id": "A", "type_id": 0}}, {"SpecialToken": {"id": "<s>", "type_id": 1}}, {"Sequence": {"id": "B", "type_id": 1}}], "special_tokens": {"<s>": {"id": "<s>", "ids": [1], "tokens": ["<s>"]}}}" />
|
808 |
+
<original_tokenizer_class value="<class 'transformers.models.llama.tokenization_llama_fast.LlamaTokenizerFast'>" />
|
809 |
+
<pad_token_id value="2" />
|
810 |
+
<processed_post_processor_template value="{"single": {"ids": [1, -1], "type_ids": [0, 0]}, "pair": {"ids": [1, -1, 1, -2], "type_ids": [0, 0, 1, 1]}}" />
|
811 |
+
<sentencepiece_version value="0.2.1" />
|
812 |
+
<skip_special_tokens value="True" />
|
813 |
+
<streaming_detokenizer value="False" />
|
814 |
+
<tiktoken_version value="0.9.0" />
|
815 |
+
<tokenizer_output_type value="i64" />
|
816 |
+
<tokenizers_version value="0.21.4" />
|
817 |
+
<transformers_version value="4.51.3" />
|
818 |
+
<use_max_padding value="False" />
|
819 |
+
<use_sentencepiece_backend value="False" />
|
820 |
+
<utf8_replace_mode value="replace" />
|
821 |
+
<with_detokenizer value="True" />
|
822 |
+
</rt_info>
|
823 |
+
</net>
|
openvino_vision_embeddings_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1b5548e5312c07d73d2359e3b9ecf8ddc87bd9e364a3d8b15eaf1ad0f72302c1
|
3 |
+
size 330795428
|
openvino_vision_embeddings_model.xml
ADDED
The diff for this file is too large to render.
See raw diff
|
|
preprocessor_config.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"crop_size": {
|
3 |
+
"height": 448,
|
4 |
+
"width": 448
|
5 |
+
},
|
6 |
+
"do_center_crop": true,
|
7 |
+
"do_convert_rgb": true,
|
8 |
+
"do_normalize": true,
|
9 |
+
"do_rescale": true,
|
10 |
+
"do_resize": true,
|
11 |
+
"image_mean": [
|
12 |
+
0.485,
|
13 |
+
0.456,
|
14 |
+
0.406
|
15 |
+
],
|
16 |
+
"image_processor_type": "CLIPImageProcessor",
|
17 |
+
"image_std": [
|
18 |
+
0.229,
|
19 |
+
0.224,
|
20 |
+
0.225
|
21 |
+
],
|
22 |
+
"resample": 3,
|
23 |
+
"rescale_factor": 0.00392156862745098,
|
24 |
+
"size": {
|
25 |
+
"shortest_edge": 448
|
26 |
+
}
|
27 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"<img>",
|
4 |
+
"</img>",
|
5 |
+
"<IMG_CONTEXT>",
|
6 |
+
"<quad>",
|
7 |
+
"</quad>",
|
8 |
+
"<ref>",
|
9 |
+
"</ref>",
|
10 |
+
"<box>",
|
11 |
+
"</box>"
|
12 |
+
],
|
13 |
+
"bos_token": {
|
14 |
+
"content": "<s>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": false,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false
|
19 |
+
},
|
20 |
+
"eos_token": {
|
21 |
+
"content": "</s>",
|
22 |
+
"lstrip": false,
|
23 |
+
"normalized": false,
|
24 |
+
"rstrip": true,
|
25 |
+
"single_word": false
|
26 |
+
},
|
27 |
+
"pad_token": {
|
28 |
+
"content": "</s>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": true,
|
32 |
+
"single_word": false
|
33 |
+
},
|
34 |
+
"unk_token": {
|
35 |
+
"content": "<unk>",
|
36 |
+
"lstrip": false,
|
37 |
+
"normalized": false,
|
38 |
+
"rstrip": false,
|
39 |
+
"single_word": false
|
40 |
+
}
|
41 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
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,215 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": null,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": true,
|
27 |
+
"single_word": false,
|
28 |
+
"special": true
|
29 |
+
},
|
30 |
+
"32000": {
|
31 |
+
"content": "<|endoftext|>",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false,
|
36 |
+
"special": true
|
37 |
+
},
|
38 |
+
"32001": {
|
39 |
+
"content": "<|assistant|>",
|
40 |
+
"lstrip": false,
|
41 |
+
"normalized": false,
|
42 |
+
"rstrip": true,
|
43 |
+
"single_word": false,
|
44 |
+
"special": true
|
45 |
+
},
|
46 |
+
"32002": {
|
47 |
+
"content": "<|placeholder1|>",
|
48 |
+
"lstrip": false,
|
49 |
+
"normalized": false,
|
50 |
+
"rstrip": true,
|
51 |
+
"single_word": false,
|
52 |
+
"special": true
|
53 |
+
},
|
54 |
+
"32003": {
|
55 |
+
"content": "<|placeholder2|>",
|
56 |
+
"lstrip": false,
|
57 |
+
"normalized": false,
|
58 |
+
"rstrip": true,
|
59 |
+
"single_word": false,
|
60 |
+
"special": true
|
61 |
+
},
|
62 |
+
"32004": {
|
63 |
+
"content": "<|placeholder3|>",
|
64 |
+
"lstrip": false,
|
65 |
+
"normalized": false,
|
66 |
+
"rstrip": true,
|
67 |
+
"single_word": false,
|
68 |
+
"special": true
|
69 |
+
},
|
70 |
+
"32005": {
|
71 |
+
"content": "<|placeholder4|>",
|
72 |
+
"lstrip": false,
|
73 |
+
"normalized": false,
|
74 |
+
"rstrip": true,
|
75 |
+
"single_word": false,
|
76 |
+
"special": true
|
77 |
+
},
|
78 |
+
"32006": {
|
79 |
+
"content": "<|system|>",
|
80 |
+
"lstrip": false,
|
81 |
+
"normalized": false,
|
82 |
+
"rstrip": true,
|
83 |
+
"single_word": false,
|
84 |
+
"special": true
|
85 |
+
},
|
86 |
+
"32007": {
|
87 |
+
"content": "<|end|>",
|
88 |
+
"lstrip": false,
|
89 |
+
"normalized": false,
|
90 |
+
"rstrip": true,
|
91 |
+
"single_word": false,
|
92 |
+
"special": true
|
93 |
+
},
|
94 |
+
"32008": {
|
95 |
+
"content": "<|placeholder5|>",
|
96 |
+
"lstrip": false,
|
97 |
+
"normalized": false,
|
98 |
+
"rstrip": true,
|
99 |
+
"single_word": false,
|
100 |
+
"special": true
|
101 |
+
},
|
102 |
+
"32009": {
|
103 |
+
"content": "<|placeholder6|>",
|
104 |
+
"lstrip": false,
|
105 |
+
"normalized": false,
|
106 |
+
"rstrip": true,
|
107 |
+
"single_word": false,
|
108 |
+
"special": true
|
109 |
+
},
|
110 |
+
"32010": {
|
111 |
+
"content": "<|user|>",
|
112 |
+
"lstrip": false,
|
113 |
+
"normalized": false,
|
114 |
+
"rstrip": true,
|
115 |
+
"single_word": false,
|
116 |
+
"special": true
|
117 |
+
},
|
118 |
+
"32011": {
|
119 |
+
"content": "<img>",
|
120 |
+
"lstrip": false,
|
121 |
+
"normalized": false,
|
122 |
+
"rstrip": false,
|
123 |
+
"single_word": false,
|
124 |
+
"special": true
|
125 |
+
},
|
126 |
+
"32012": {
|
127 |
+
"content": "</img>",
|
128 |
+
"lstrip": false,
|
129 |
+
"normalized": false,
|
130 |
+
"rstrip": false,
|
131 |
+
"single_word": false,
|
132 |
+
"special": true
|
133 |
+
},
|
134 |
+
"32013": {
|
135 |
+
"content": "<IMG_CONTEXT>",
|
136 |
+
"lstrip": false,
|
137 |
+
"normalized": false,
|
138 |
+
"rstrip": false,
|
139 |
+
"single_word": false,
|
140 |
+
"special": true
|
141 |
+
},
|
142 |
+
"32014": {
|
143 |
+
"content": "<quad>",
|
144 |
+
"lstrip": false,
|
145 |
+
"normalized": false,
|
146 |
+
"rstrip": false,
|
147 |
+
"single_word": false,
|
148 |
+
"special": true
|
149 |
+
},
|
150 |
+
"32015": {
|
151 |
+
"content": "</quad>",
|
152 |
+
"lstrip": false,
|
153 |
+
"normalized": false,
|
154 |
+
"rstrip": false,
|
155 |
+
"single_word": false,
|
156 |
+
"special": true
|
157 |
+
},
|
158 |
+
"32016": {
|
159 |
+
"content": "<ref>",
|
160 |
+
"lstrip": false,
|
161 |
+
"normalized": false,
|
162 |
+
"rstrip": false,
|
163 |
+
"single_word": false,
|
164 |
+
"special": true
|
165 |
+
},
|
166 |
+
"32017": {
|
167 |
+
"content": "</ref>",
|
168 |
+
"lstrip": false,
|
169 |
+
"normalized": false,
|
170 |
+
"rstrip": false,
|
171 |
+
"single_word": false,
|
172 |
+
"special": true
|
173 |
+
},
|
174 |
+
"32018": {
|
175 |
+
"content": "<box>",
|
176 |
+
"lstrip": false,
|
177 |
+
"normalized": false,
|
178 |
+
"rstrip": false,
|
179 |
+
"single_word": false,
|
180 |
+
"special": true
|
181 |
+
},
|
182 |
+
"32019": {
|
183 |
+
"content": "</box>",
|
184 |
+
"lstrip": false,
|
185 |
+
"normalized": false,
|
186 |
+
"rstrip": false,
|
187 |
+
"single_word": false,
|
188 |
+
"special": true
|
189 |
+
}
|
190 |
+
},
|
191 |
+
"additional_special_tokens": [
|
192 |
+
"<img>",
|
193 |
+
"</img>",
|
194 |
+
"<IMG_CONTEXT>",
|
195 |
+
"<quad>",
|
196 |
+
"</quad>",
|
197 |
+
"<ref>",
|
198 |
+
"</ref>",
|
199 |
+
"<box>",
|
200 |
+
"</box>"
|
201 |
+
],
|
202 |
+
"bos_token": "<s>",
|
203 |
+
"chat_template": "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') %}{{'<|user|>' + '\n' + message['content'] + '<|end|>' + '\n' + '<|assistant|>' + '\n'}}{% elif (message['role'] == 'assistant') %}{{message['content'] + '<|end|>' + '\n'}}{% endif %}{% endfor %}",
|
204 |
+
"clean_up_tokenization_spaces": false,
|
205 |
+
"eos_token": "</s>",
|
206 |
+
"extra_special_tokens": {},
|
207 |
+
"legacy": false,
|
208 |
+
"model_max_length": 8192,
|
209 |
+
"pad_token": "</s>",
|
210 |
+
"sp_model_kwargs": {},
|
211 |
+
"spaces_between_special_tokens": false,
|
212 |
+
"tokenizer_class": "LlamaTokenizer",
|
213 |
+
"unk_token": "<unk>",
|
214 |
+
"use_default_system_prompt": false
|
215 |
+
}
|