dineshananthi commited on
Commit
5dc6ff5
·
verified ·
1 Parent(s): 7056137

Add extracted LoRA adapter + projection head from checkpoint-72000

Browse files
README.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: ibm-granite/granite-vision-4.1-4b
3
+ library_name: peft
4
+ tags:
5
+ - colbert
6
+ - late-interaction
7
+ - visual-retrieval
8
+ - colpali
9
+ ---
10
+
11
+ # ColGranite 4.1-4B — LoRA Adapter
12
+
13
+ Late-interaction (ColBERT-style) visual retrieval adapter on top of
14
+ [`ibm-granite/granite-vision-4.1-4b`](https://huggingface.co/ibm-granite/granite-vision-4.1-4b).
15
+
16
+ ## Contents
17
+ - `adapter_config.json`, `adapter_model.safetensors` — LoRA adapter (text-decoder projections)
18
+ - `col_linear_head.pt` — the trained 2560 to 128 projection head (REQUIRED for retrieval)
19
+ - processor / tokenizer files
20
+
21
+ ## Usage
22
+ Rebuild the `ColGranite` wrapper, attach this adapter to the inner model with
23
+ `PeftModel.from_pretrained(...)`, then load `col_linear_head.pt` into the projection head.
adapter_config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "ibm-granite/granite-vision-4.1-4b",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": "gaussian",
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 32,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "megatron_config": null,
23
+ "megatron_core": "megatron.core",
24
+ "modules_to_save": null,
25
+ "peft_type": "LORA",
26
+ "peft_version": "0.18.0",
27
+ "qalora_group_size": 16,
28
+ "r": 32,
29
+ "rank_pattern": {},
30
+ "revision": null,
31
+ "target_modules": "(.*(language_model|text_model).*(down_proj|gate_proj|up_proj|k_proj|q_proj|v_proj|o_proj).*$)",
32
+ "target_parameters": null,
33
+ "task_type": "FEATURE_EXTRACTION",
34
+ "trainable_token_indices": null,
35
+ "use_dora": false,
36
+ "use_qalora": false,
37
+ "use_rslora": false
38
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ef58871b6fa1d9ae0e0ec12fde1273b3b09af96d65fb43e99fba5badf818007
3
+ size 249117008
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "<image>": 100352
3
+ }
chat_template.jinja ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#- ===== Task tag prompt constants ===== -#}
2
+ {%- set chart2code_prompt = "Generate code that recreates the chart as best as possible." -%}
3
+ {%- set chart2csv_prompt = "Please examine this chart image. Consider you are a data visualization expert, and extract the data into a CSV table.\n\nYour CSV should:\n- Include a header row with clear column names\n- Represent all data series/categories shown in the chart\n- Use numeric values that match the chart as closely as possible\n\nOutput only the CSV data, nothing else." -%}
4
+ {%- set chart2summary_prompt = "Can you describe this chart image?" -%}
5
+ {%- set tables_json_prompt = "Identify and extract the table schema\n Extract the schema of all the tables in the image sorted according to the reading order.\nThe output must be a valid JSON object containing a list of dictionaries with the following structure:\n\n {\n \"dimensions\": {\n \"rows\": <number of data rows (excluding header rows)>,\n \"columns\": <number of columns>,\n \"header_rows\": <number of header rows>,\n \"total_rows\": <total number of rows including headers>\n },\n \"cells\": [\n {\n \"row\": <row index starting at 1>,\n \"col\": <column index starting at 1>,\n \"colspan\": <number of columns spanned>,\n \"rowspan\": <number of rows spanned>,\n \"type\": \"<'header' or 'data'>\",\n \"header_level\": <header nesting level if type=header, else omit or null>,\n \"content\": \"<string content of the cell>\"\n },\n ...\n ]\n }" -%}
6
+ {%- set tables_html_prompt = "Identify and extract the table schema\n Extract the schema of all the tables in the image sorted according to the reading order.\nThe output must be a list of valid HTML tables" -%}
7
+ {%- set tables_otsl_prompt = "Identify and extract the table schema\n Extract the schema of all the tables in the image sorted according to the reading order.\nThe output must be a list of valid OTSL objects, each consists of the following fields: \n <fcel> - a cell with content in it\n <ecel> - an empty cell\n <lcel> - a cell that is merged with the cell to its left\n <ucel> - a cell that is merged with the cell above it\n <xcel> - a cell that is merged with both the cell above it and the cell to its left\n <nl> - a new line\n <ched> - a column header\n <otsl> - the beginning of the OTSL table\n </otsl> - the end of the OTSL table\n\n An example for an output:\n [\n <otsl><ched>first table header1<ched>first table header2<nl><fcel>data1<fcel>data2<nl><fcel>data with horizontal span<lcel><nl><fcel>data with vertical span<ecel><nl><ucel><fcel>data3<nl></otsl>,\n <otsl><ched>second table header1<ched>second table header2<nl><fcel>data1<fcel>data2<nl><fcel>data with horizontal span<lcel><nl><fcel>data with vertical span<ecel><nl><ucel><fcel>data3<nl></otsl>\n ]" -%}
8
+
9
+
10
+ {#- ===== Tag expansion dispatcher ===== -#}
11
+ {%- macro expand_tags(text) -%}
12
+ {%- set has_image = "<image>" in text -%}
13
+ {#- Determine image position: prefix if <image> appears before the tag, suffix if after -#}
14
+ {%- if has_image -%}
15
+ {%- set img_idx = text.index("<image>") -%}
16
+ {%- if "<chart2code>" in text -%}{%- set tag_idx = text.index("<chart2code>") -%}
17
+ {%- elif "<chart2csv>" in text -%}{%- set tag_idx = text.index("<chart2csv>") -%}
18
+ {%- elif "<chart2summary>" in text -%}{%- set tag_idx = text.index("<chart2summary>") -%}
19
+ {%- elif "<tables_json>" in text -%}{%- set tag_idx = text.index("<tables_json>") -%}
20
+ {%- elif "<tables_html>" in text -%}{%- set tag_idx = text.index("<tables_html>") -%}
21
+ {%- elif "<tables_otsl>" in text -%}{%- set tag_idx = text.index("<tables_otsl>") -%}
22
+ {%- else -%}{%- set tag_idx = 999999 -%}
23
+ {%- endif -%}
24
+ {%- set img_prefix = "<image>\n" if img_idx < tag_idx else "" -%}
25
+ {%- set img_suffix = "<image>\n" if img_idx >= tag_idx else "" -%}
26
+ {%- else -%}
27
+ {%- set img_prefix = "" -%}
28
+ {%- set img_suffix = "" -%}
29
+ {%- endif -%}
30
+ {%- if "<chart2code>" in text -%}
31
+ {{- img_prefix + chart2code_prompt + img_suffix -}}
32
+ {%- elif "<chart2csv>" in text -%}
33
+ {{- img_prefix + chart2csv_prompt + img_suffix -}}
34
+ {%- elif "<chart2summary>" in text -%}
35
+ {{- img_prefix + chart2summary_prompt + img_suffix -}}
36
+ {%- elif "<tables_json>" in text -%}
37
+ {{- img_prefix + tables_json_prompt + img_suffix -}}
38
+ {%- elif "<tables_html>" in text -%}
39
+ {{- img_prefix + tables_html_prompt + img_suffix -}}
40
+ {%- elif "<tables_otsl>" in text -%}
41
+ {{- img_prefix + tables_otsl_prompt + img_suffix -}}
42
+ {%- else -%}
43
+ {{- text -}}
44
+ {%- endif -%}
45
+ {%- endmacro -%}
46
+
47
+ {#- ===== Original chat template ===== -#}
48
+ {% macro render_content(x) %}
49
+ {%- if x is string %}
50
+ {{ x }}
51
+ {%- else %}
52
+ {%- for chunk in x %}
53
+ {%- if chunk['type'] == 'text' -%}
54
+ {{ chunk['text']}}
55
+ {%- elif chunk['type'] == 'image' -%}
56
+ {{- "<image>
57
+ " }}
58
+ {%- endif -%}
59
+ {%- endfor -%}
60
+ {%- endif -%}
61
+ {% endmacro %}
62
+
63
+ {%- set tools_system_message_prefix = 'You are a helpful assistant with access to the following tools. You may call one or more tools to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>' %}
64
+ {%- set tools_system_message_suffix = '\n</tools>\n\nFor each tool call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call>. If a tool does not exist in the provided list of tools, notify the user that you do not have the ability to fulfill the request.' %}
65
+ {%- set documents_system_message_prefix = 'You are a helpful assistant with access to the following documents. You may use one or more documents to assist with the user query.\n\nYou are given a list of documents within <documents></documents> XML tags:\n<documents>' %}
66
+ {%- set documents_system_message_suffix = '\n</documents>\n\nWrite the response to the user\'s input by strictly aligning with the facts in the provided documents. If the information needed to answer the question is not available in the documents, inform the user that the question cannot be answered based on the available data.' %}
67
+ {%- set g4_default_system_message = 'You are a helpful assistant. Please ensure responses are professional, accurate, and safe.' %}
68
+ {%- if available_tools is defined and available_tools %}
69
+ {%- set tools = available_tools %}
70
+ {%- endif %}
71
+ {%- set ns = namespace(tools_system_message=tools_system_message_prefix,
72
+ documents_system_message=documents_system_message_prefix,
73
+ default_system_message=g4_default_system_message,
74
+ system_message=''
75
+ ) %}
76
+ {%- if tools %}
77
+ {%- for tool in tools %}
78
+ {%- set ns.tools_system_message = ns.tools_system_message + '\n' + (tool | tojson) %}
79
+ {%- endfor %}
80
+ {%- set ns.tools_system_message = ns.tools_system_message + tools_system_message_suffix %}
81
+ {%- else %}
82
+ {%- set ns.tools_system_message = '' %}
83
+ {%- endif %}
84
+ {%- if documents %}
85
+ {%- for document in documents %}
86
+ {%- set ns.documents_system_message = ns.documents_system_message + '\n' + (document | tojson) %}
87
+ {%- endfor %}
88
+ {%- set ns.documents_system_message = ns.documents_system_message + documents_system_message_suffix %}
89
+ {%- else %}
90
+ {%- set ns.documents_system_message = '' %}
91
+ {%- endif %}
92
+ {%- if messages[0].role == 'system' %}
93
+ {%- if messages[0].content is string %}
94
+ {%- set ns.system_message = messages[0].content %}
95
+ {%- elif messages[0].content is iterable %}
96
+ {%- for entry in messages[0].content %}
97
+ {%- if entry.type== 'text' %}
98
+ {%- if ns.system_message != '' %}
99
+ {%- set ns.system_message = ns.system_message + '\n' %}
100
+ {%- endif %}
101
+ {%- set ns.system_message = ns.system_message + entry.text %}
102
+ {%- endif %}
103
+ {%- endfor %}
104
+ {%- endif %}
105
+ {%- if tools and documents %}
106
+ {%- set ns.system_message = ns.system_message + '\n\n' + ns.tools_system_message + '\n\n' + ns.documents_system_message %}
107
+ {%- elif tools %}
108
+ {%- set ns.system_message = ns.system_message + '\n\n' + ns.tools_system_message %}
109
+ {%- elif documents %}
110
+ {%- set ns.system_message = ns.system_message + '\n\n' + ns.documents_system_message %}
111
+ {%- endif %}
112
+ {%- else %}
113
+ {%- if tools and documents %}
114
+ {%- set ns.system_message = ns.tools_system_message + '\n\n' + ns.documents_system_message %}
115
+ {%- elif tools %}
116
+ {%- set ns.system_message = ns.tools_system_message %}
117
+ {%- elif documents %}
118
+ {%- set ns.system_message = ns.documents_system_message %}
119
+ {%- endif %}
120
+ {%- endif %}
121
+ {%- if ns.system_message %}
122
+ {{- '<|start_of_role|>system<|end_of_role|>' + ns.system_message + '<|end_of_text|>\n' }}
123
+ {%- else %}
124
+ {{- '<|start_of_role|>system<|end_of_role|>' + ns.default_system_message + '<|end_of_text|>\n' }}
125
+ {%- endif %}
126
+ {%- for message in messages %}
127
+ {%- set content = namespace(val='') %}
128
+ {%- if render_content(message['content']) is string %}
129
+ {%- set content.val = render_content(message['content']) %}
130
+ {%- else %}
131
+ {%- if render_content(message['content']) is iterable %}
132
+ {%- for entry in render_content(message['content']) %}
133
+ {%- if entry.type== 'text' %}
134
+ {%- if content.val != '' %}
135
+ {%- set content.val = content.val + '\n' %}
136
+ {%- endif %}
137
+ {%- set content.val = content.val + entry.text %}
138
+ {%- endif %}
139
+ {%- endfor %}
140
+ {%- endif %}
141
+ {%- endif %}
142
+ {%- if (message.role == 'user') or (message.role == 'system' and not loop.first) %}
143
+ {{- '<|start_of_role|>' + message.role + '<|end_of_role|>' + expand_tags(content.val) + '<|end_of_text|>\n' }}
144
+ {%- elif message.role == 'assistant' %}
145
+ {{- '<|start_of_role|>' + message.role + '<|end_of_role|>' + content.val }}
146
+ {%- if message.tool_calls %}
147
+ {%- for tool_call in message.tool_calls %}
148
+ {%- if (loop.first and content.val) or (not loop.first) %}
149
+ {{- '\n' }}
150
+ {%- endif %}
151
+ {%- if tool_call.function %}
152
+ {%- set tool_call = tool_call.function %}
153
+ {%- endif %}
154
+ {{- '<tool_call>\n{"name": "' }}
155
+ {{- tool_call.name }}
156
+ {{- '", "arguments": ' }}
157
+ {%- if tool_call.arguments is string %}
158
+ {{- tool_call.arguments }}
159
+ {%- else %}
160
+ {{- tool_call.arguments | tojson }}
161
+ {%- endif %}
162
+ {{- '}\n</tool_call>' }}
163
+ {%- endfor %}
164
+ {%- endif %}
165
+ {{- '<|end_of_text|>\n' }}
166
+ {%- elif message.role == 'tool' %}
167
+ {%- if loop.first or (messages[loop.index0 - 1].role != 'tool') %}
168
+ {{- '<|start_of_role|>user<|end_of_role|>' }}
169
+ {%- endif %}
170
+ {{- '\n<tool_response>\n' }}
171
+ {{- content.val }}
172
+ {{- '\n</tool_response>' }}
173
+ {%- if loop.last or (messages[loop.index0 + 1].role != 'tool') %}
174
+ {{- '<|end_of_text|>\n' }}
175
+ {%- endif %}
176
+ {%- endif %}
177
+ {%- endfor %}
178
+ {%- if add_generation_prompt %}
179
+ {{- '<|start_of_role|>assistant<|end_of_role|>' }}
180
+ {%- endif %}
col_linear_head.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6237306827c71a95c3153ad77dd58a40833fa414b4eb6600b42eab2afa710805
3
+ size 657573
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
preprocessor_config.json ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoProcessor": "processing.Granite4VisionProcessor"
4
+ },
5
+ "crop_size": {
6
+ "height": 384,
7
+ "width": 384
8
+ },
9
+ "do_center_crop": true,
10
+ "do_convert_rgb": true,
11
+ "do_normalize": true,
12
+ "do_pad": true,
13
+ "do_rescale": true,
14
+ "do_resize": true,
15
+ "image_grid_pinpoints": [
16
+ [
17
+ 384,
18
+ 384
19
+ ],
20
+ [
21
+ 384,
22
+ 768
23
+ ],
24
+ [
25
+ 384,
26
+ 1152
27
+ ],
28
+ [
29
+ 384,
30
+ 1536
31
+ ],
32
+ [
33
+ 384,
34
+ 1920
35
+ ],
36
+ [
37
+ 384,
38
+ 2304
39
+ ],
40
+ [
41
+ 384,
42
+ 2688
43
+ ],
44
+ [
45
+ 384,
46
+ 3072
47
+ ],
48
+ [
49
+ 384,
50
+ 3456
51
+ ],
52
+ [
53
+ 384,
54
+ 3840
55
+ ],
56
+ [
57
+ 768,
58
+ 384
59
+ ],
60
+ [
61
+ 768,
62
+ 768
63
+ ],
64
+ [
65
+ 768,
66
+ 1152
67
+ ],
68
+ [
69
+ 768,
70
+ 1536
71
+ ],
72
+ [
73
+ 768,
74
+ 1920
75
+ ],
76
+ [
77
+ 1152,
78
+ 384
79
+ ],
80
+ [
81
+ 1152,
82
+ 768
83
+ ],
84
+ [
85
+ 1152,
86
+ 1152
87
+ ],
88
+ [
89
+ 1536,
90
+ 384
91
+ ],
92
+ [
93
+ 1536,
94
+ 768
95
+ ],
96
+ [
97
+ 1920,
98
+ 384
99
+ ],
100
+ [
101
+ 1920,
102
+ 768
103
+ ],
104
+ [
105
+ 2304,
106
+ 384
107
+ ],
108
+ [
109
+ 2688,
110
+ 384
111
+ ],
112
+ [
113
+ 3072,
114
+ 384
115
+ ],
116
+ [
117
+ 3456,
118
+ 384
119
+ ],
120
+ [
121
+ 3840,
122
+ 384
123
+ ]
124
+ ],
125
+ "image_mean": [
126
+ 0.5,
127
+ 0.5,
128
+ 0.5
129
+ ],
130
+ "image_processor_type": "LlavaNextImageProcessor",
131
+ "image_std": [
132
+ 0.5,
133
+ 0.5,
134
+ 0.5
135
+ ],
136
+ "processor_class": "Granite4VisionProcessor",
137
+ "resample": 3,
138
+ "rescale_factor": 0.00392156862745098,
139
+ "size": {
140
+ "height": 384,
141
+ "width": 384
142
+ }
143
+ }
processing.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fractions import Fraction
2
+
3
+ from transformers import LlavaNextProcessor
4
+ from transformers.image_processing_utils import select_best_resolution
5
+
6
+
7
+
8
+ class Granite4VisionProcessor(LlavaNextProcessor):
9
+ model_type = "granite4_vision"
10
+
11
+ def __init__(
12
+ self,
13
+ image_processor=None,
14
+ tokenizer=None,
15
+ patch_size=None,
16
+ vision_feature_select_strategy=None,
17
+ chat_template=None,
18
+ image_token="<image>", # set the default and let users change if they have peculiar special tokens in rare cases
19
+ num_additional_image_tokens=0,
20
+ downsample_rate=None,
21
+ **kwargs,
22
+ ):
23
+ super().__init__(image_processor=image_processor,
24
+ tokenizer=tokenizer,
25
+ patch_size=patch_size,
26
+ vision_feature_select_strategy=vision_feature_select_strategy,
27
+ chat_template=chat_template,
28
+ image_token=image_token,
29
+ num_additional_image_tokens=num_additional_image_tokens,
30
+ )
31
+ self.downsample_rate = downsample_rate
32
+
33
+ def _get_number_of_features(self, orig_height: int, orig_width: int, height: int, width: int) -> int:
34
+ image_grid_pinpoints = self.image_processor.image_grid_pinpoints
35
+
36
+ height_best_resolution, width_best_resolution = select_best_resolution(
37
+ [orig_height, orig_width], image_grid_pinpoints
38
+ )
39
+ scale_height, scale_width = height_best_resolution // height, width_best_resolution // width
40
+
41
+ patches_height = height // self.patch_size
42
+ patches_width = width // self.patch_size
43
+ if self.downsample_rate is not None:
44
+ ds_rate = Fraction(self.downsample_rate)
45
+ patches_height = int(patches_height * ds_rate)
46
+ patches_width = int(patches_width * ds_rate)
47
+
48
+ unpadded_features, newline_features = self._get_unpadded_features(
49
+ orig_height, orig_width, patches_height, patches_width, scale_height, scale_width
50
+ )
51
+ # The base patch covers the entire image (+1 for the CLS)
52
+ base_features = patches_height * patches_width + self.num_additional_image_tokens
53
+ num_image_tokens = unpadded_features + newline_features + base_features
54
+ return num_image_tokens
processor_config.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoProcessor": "processing.Granite4VisionProcessor"
4
+ },
5
+ "downsample_rate": "4/8",
6
+ "image_token": "<image>",
7
+ "num_additional_image_tokens": 0,
8
+ "patch_size": 16,
9
+ "processor_class": "Granite4VisionProcessor",
10
+ "vision_feature_select_strategy": "full"
11
+ }
push_adapter.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+ """
3
+ push_adapter.py
4
+ Push the extracted LoRA adapter + projection head + processor to the Hub.
5
+ This pushes the SMALL artifacts (adapter, not the 8GB merged model).
6
+ """
7
+ import os
8
+ from huggingface_hub import HfApi, create_repo
9
+
10
+ ADAPTER_DIR = "/workspace/models/colgranite-4.1-4b-lora-extracted"
11
+ REPO_ID = "dineshananthi/colgranite-4.1-4b-lora-72k" # <-- your adapter repo
12
+ PRIVATE = False
13
+
14
+ api = HfApi()
15
+
16
+ # 1. Create the repo if it doesn't exist (no-op if it already does)
17
+ create_repo(REPO_ID, repo_type="model", private=PRIVATE, exist_ok=True)
18
+ print(f"Repo ready: {REPO_ID}")
19
+
20
+ # 2. Optional README so the page explains what this is
21
+ readme = f"""---
22
+ base_model: ibm-granite/granite-vision-4.1-4b
23
+ library_name: peft
24
+ tags:
25
+ - colbert
26
+ - late-interaction
27
+ - visual-retrieval
28
+ - colpali
29
+ ---
30
+
31
+ # ColGranite 4.1-4B — LoRA Adapter
32
+
33
+ Late-interaction (ColBERT-style) visual retrieval adapter on top of
34
+ [`ibm-granite/granite-vision-4.1-4b`](https://huggingface.co/ibm-granite/granite-vision-4.1-4b).
35
+
36
+ ## Contents
37
+ - `adapter_config.json`, `adapter_model.safetensors` — LoRA adapter (text-decoder projections)
38
+ - `col_linear_head.pt` — the trained 2560 to 128 projection head (REQUIRED for retrieval)
39
+ - processor / tokenizer files
40
+
41
+ ## Usage
42
+ Rebuild the `ColGranite` wrapper, attach this adapter to the inner model with
43
+ `PeftModel.from_pretrained(...)`, then load `col_linear_head.pt` into the projection head.
44
+ """
45
+ with open(os.path.join(ADAPTER_DIR, "README.md"), "w") as f:
46
+ f.write(readme)
47
+
48
+ # 3. Upload the whole folder (adapter + head + processor + README)
49
+ print("Uploading folder...")
50
+ api.upload_folder(
51
+ folder_path=ADAPTER_DIR,
52
+ repo_id=REPO_ID,
53
+ repo_type="model",
54
+ commit_message="Add extracted LoRA adapter + projection head from checkpoint-72000",
55
+ )
56
+
57
+ print("\nDONE ->", f"https://huggingface.co/{REPO_ID}")
special_tokens_map.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<image>"
4
+ ],
5
+ "bos_token": {
6
+ "content": "<|end_of_text|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "eos_token": {
13
+ "content": "<|end_of_text|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false
18
+ },
19
+ "pad_token": {
20
+ "content": "<|pad|>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false
25
+ },
26
+ "unk_token": {
27
+ "content": "<|unk|>",
28
+ "lstrip": false,
29
+ "normalized": false,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ }
33
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,799 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "100256": {
6
+ "content": "<|pad|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "100257": {
14
+ "content": "<|end_of_text|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "100258": {
22
+ "content": "<|fim_prefix|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": false
28
+ },
29
+ "100259": {
30
+ "content": "<|fim_middle|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": false
36
+ },
37
+ "100260": {
38
+ "content": "<|fim_suffix|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": false
44
+ },
45
+ "100261": {
46
+ "content": "<|fim_pad|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": false
52
+ },
53
+ "100262": {
54
+ "content": "<|filename|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": false
60
+ },
61
+ "100263": {
62
+ "content": "<|reponame|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": false
68
+ },
69
+ "100264": {
70
+ "content": "<|start_of_role|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "100265": {
78
+ "content": "<|end_of_role|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "100266": {
86
+ "content": "<|unused_1|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "100267": {
94
+ "content": "<|start_of_plugin|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "100268": {
102
+ "content": "<|end_of_plugin|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "100269": {
110
+ "content": "<|unk|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "100270": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "100271": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "100272": {
134
+ "content": "<tool_response>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "100273": {
142
+ "content": "</tool_response>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "100274": {
150
+ "content": "<think>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "100275": {
158
+ "content": "</think>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "100276": {
166
+ "content": "<think_on>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": true
172
+ },
173
+ "100277": {
174
+ "content": "<think_off>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": true
180
+ },
181
+ "100278": {
182
+ "content": "<schema>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": true
188
+ },
189
+ "100279": {
190
+ "content": "</schema>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": true
196
+ },
197
+ "100280": {
198
+ "content": "<tools>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": true
204
+ },
205
+ "100281": {
206
+ "content": "</tools>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": true
212
+ },
213
+ "100282": {
214
+ "content": "<documents>",
215
+ "lstrip": false,
216
+ "normalized": false,
217
+ "rstrip": false,
218
+ "single_word": false,
219
+ "special": true
220
+ },
221
+ "100283": {
222
+ "content": "</documents>",
223
+ "lstrip": false,
224
+ "normalized": false,
225
+ "rstrip": false,
226
+ "single_word": false,
227
+ "special": true
228
+ },
229
+ "100284": {
230
+ "content": "<|unused_15|>",
231
+ "lstrip": false,
232
+ "normalized": false,
233
+ "rstrip": false,
234
+ "single_word": false,
235
+ "special": true
236
+ },
237
+ "100285": {
238
+ "content": "<|unused_16|>",
239
+ "lstrip": false,
240
+ "normalized": false,
241
+ "rstrip": false,
242
+ "single_word": false,
243
+ "special": true
244
+ },
245
+ "100286": {
246
+ "content": "<|unused_17|>",
247
+ "lstrip": false,
248
+ "normalized": false,
249
+ "rstrip": false,
250
+ "single_word": false,
251
+ "special": true
252
+ },
253
+ "100287": {
254
+ "content": "<|unused_18|>",
255
+ "lstrip": false,
256
+ "normalized": false,
257
+ "rstrip": false,
258
+ "single_word": false,
259
+ "special": true
260
+ },
261
+ "100288": {
262
+ "content": "<|unused_19|>",
263
+ "lstrip": false,
264
+ "normalized": false,
265
+ "rstrip": false,
266
+ "single_word": false,
267
+ "special": true
268
+ },
269
+ "100289": {
270
+ "content": "<|unused_20|>",
271
+ "lstrip": false,
272
+ "normalized": false,
273
+ "rstrip": false,
274
+ "single_word": false,
275
+ "special": true
276
+ },
277
+ "100290": {
278
+ "content": "<|unused_21|>",
279
+ "lstrip": false,
280
+ "normalized": false,
281
+ "rstrip": false,
282
+ "single_word": false,
283
+ "special": true
284
+ },
285
+ "100291": {
286
+ "content": "<|unused_22|>",
287
+ "lstrip": false,
288
+ "normalized": false,
289
+ "rstrip": false,
290
+ "single_word": false,
291
+ "special": true
292
+ },
293
+ "100292": {
294
+ "content": "<|unused_23|>",
295
+ "lstrip": false,
296
+ "normalized": false,
297
+ "rstrip": false,
298
+ "single_word": false,
299
+ "special": true
300
+ },
301
+ "100293": {
302
+ "content": "<|unused_24|>",
303
+ "lstrip": false,
304
+ "normalized": false,
305
+ "rstrip": false,
306
+ "single_word": false,
307
+ "special": true
308
+ },
309
+ "100294": {
310
+ "content": "<|unused_25|>",
311
+ "lstrip": false,
312
+ "normalized": false,
313
+ "rstrip": false,
314
+ "single_word": false,
315
+ "special": true
316
+ },
317
+ "100295": {
318
+ "content": "<|unused_26|>",
319
+ "lstrip": false,
320
+ "normalized": false,
321
+ "rstrip": false,
322
+ "single_word": false,
323
+ "special": true
324
+ },
325
+ "100296": {
326
+ "content": "<|unused_27|>",
327
+ "lstrip": false,
328
+ "normalized": false,
329
+ "rstrip": false,
330
+ "single_word": false,
331
+ "special": true
332
+ },
333
+ "100297": {
334
+ "content": "<|unused_28|>",
335
+ "lstrip": false,
336
+ "normalized": false,
337
+ "rstrip": false,
338
+ "single_word": false,
339
+ "special": true
340
+ },
341
+ "100298": {
342
+ "content": "<|unused_29|>",
343
+ "lstrip": false,
344
+ "normalized": false,
345
+ "rstrip": false,
346
+ "single_word": false,
347
+ "special": true
348
+ },
349
+ "100299": {
350
+ "content": "<|unused_30|>",
351
+ "lstrip": false,
352
+ "normalized": false,
353
+ "rstrip": false,
354
+ "single_word": false,
355
+ "special": true
356
+ },
357
+ "100300": {
358
+ "content": "<|unused_31|>",
359
+ "lstrip": false,
360
+ "normalized": false,
361
+ "rstrip": false,
362
+ "single_word": false,
363
+ "special": true
364
+ },
365
+ "100301": {
366
+ "content": "<|unused_32|>",
367
+ "lstrip": false,
368
+ "normalized": false,
369
+ "rstrip": false,
370
+ "single_word": false,
371
+ "special": true
372
+ },
373
+ "100302": {
374
+ "content": "<|unused_33|>",
375
+ "lstrip": false,
376
+ "normalized": false,
377
+ "rstrip": false,
378
+ "single_word": false,
379
+ "special": true
380
+ },
381
+ "100303": {
382
+ "content": "<|unused_34|>",
383
+ "lstrip": false,
384
+ "normalized": false,
385
+ "rstrip": false,
386
+ "single_word": false,
387
+ "special": true
388
+ },
389
+ "100304": {
390
+ "content": "<|unused_35|>",
391
+ "lstrip": false,
392
+ "normalized": false,
393
+ "rstrip": false,
394
+ "single_word": false,
395
+ "special": true
396
+ },
397
+ "100305": {
398
+ "content": "<|unused_36|>",
399
+ "lstrip": false,
400
+ "normalized": false,
401
+ "rstrip": false,
402
+ "single_word": false,
403
+ "special": true
404
+ },
405
+ "100306": {
406
+ "content": "<|unused_37|>",
407
+ "lstrip": false,
408
+ "normalized": false,
409
+ "rstrip": false,
410
+ "single_word": false,
411
+ "special": true
412
+ },
413
+ "100307": {
414
+ "content": "<|unused_38|>",
415
+ "lstrip": false,
416
+ "normalized": false,
417
+ "rstrip": false,
418
+ "single_word": false,
419
+ "special": true
420
+ },
421
+ "100308": {
422
+ "content": "<|unused_39|>",
423
+ "lstrip": false,
424
+ "normalized": false,
425
+ "rstrip": false,
426
+ "single_word": false,
427
+ "special": true
428
+ },
429
+ "100309": {
430
+ "content": "<|unused_40|>",
431
+ "lstrip": false,
432
+ "normalized": false,
433
+ "rstrip": false,
434
+ "single_word": false,
435
+ "special": true
436
+ },
437
+ "100310": {
438
+ "content": "<|unused_41|>",
439
+ "lstrip": false,
440
+ "normalized": false,
441
+ "rstrip": false,
442
+ "single_word": false,
443
+ "special": true
444
+ },
445
+ "100311": {
446
+ "content": "<|unused_42|>",
447
+ "lstrip": false,
448
+ "normalized": false,
449
+ "rstrip": false,
450
+ "single_word": false,
451
+ "special": true
452
+ },
453
+ "100312": {
454
+ "content": "<|unused_43|>",
455
+ "lstrip": false,
456
+ "normalized": false,
457
+ "rstrip": false,
458
+ "single_word": false,
459
+ "special": true
460
+ },
461
+ "100313": {
462
+ "content": "<|unused_44|>",
463
+ "lstrip": false,
464
+ "normalized": false,
465
+ "rstrip": false,
466
+ "single_word": false,
467
+ "special": true
468
+ },
469
+ "100314": {
470
+ "content": "<|unused_45|>",
471
+ "lstrip": false,
472
+ "normalized": false,
473
+ "rstrip": false,
474
+ "single_word": false,
475
+ "special": true
476
+ },
477
+ "100315": {
478
+ "content": "<|unused_46|>",
479
+ "lstrip": false,
480
+ "normalized": false,
481
+ "rstrip": false,
482
+ "single_word": false,
483
+ "special": true
484
+ },
485
+ "100316": {
486
+ "content": "<|unused_47|>",
487
+ "lstrip": false,
488
+ "normalized": false,
489
+ "rstrip": false,
490
+ "single_word": false,
491
+ "special": true
492
+ },
493
+ "100317": {
494
+ "content": "<|unused_48|>",
495
+ "lstrip": false,
496
+ "normalized": false,
497
+ "rstrip": false,
498
+ "single_word": false,
499
+ "special": true
500
+ },
501
+ "100318": {
502
+ "content": "<|unused_49|>",
503
+ "lstrip": false,
504
+ "normalized": false,
505
+ "rstrip": false,
506
+ "single_word": false,
507
+ "special": true
508
+ },
509
+ "100319": {
510
+ "content": "<|unused_50|>",
511
+ "lstrip": false,
512
+ "normalized": false,
513
+ "rstrip": false,
514
+ "single_word": false,
515
+ "special": true
516
+ },
517
+ "100320": {
518
+ "content": "<|unused_51|>",
519
+ "lstrip": false,
520
+ "normalized": false,
521
+ "rstrip": false,
522
+ "single_word": false,
523
+ "special": true
524
+ },
525
+ "100321": {
526
+ "content": "<|unused_52|>",
527
+ "lstrip": false,
528
+ "normalized": false,
529
+ "rstrip": false,
530
+ "single_word": false,
531
+ "special": true
532
+ },
533
+ "100322": {
534
+ "content": "<|unused_53|>",
535
+ "lstrip": false,
536
+ "normalized": false,
537
+ "rstrip": false,
538
+ "single_word": false,
539
+ "special": true
540
+ },
541
+ "100323": {
542
+ "content": "<|unused_54|>",
543
+ "lstrip": false,
544
+ "normalized": false,
545
+ "rstrip": false,
546
+ "single_word": false,
547
+ "special": true
548
+ },
549
+ "100324": {
550
+ "content": "<|unused_55|>",
551
+ "lstrip": false,
552
+ "normalized": false,
553
+ "rstrip": false,
554
+ "single_word": false,
555
+ "special": true
556
+ },
557
+ "100325": {
558
+ "content": "<|unused_56|>",
559
+ "lstrip": false,
560
+ "normalized": false,
561
+ "rstrip": false,
562
+ "single_word": false,
563
+ "special": true
564
+ },
565
+ "100326": {
566
+ "content": "<|unused_57|>",
567
+ "lstrip": false,
568
+ "normalized": false,
569
+ "rstrip": false,
570
+ "single_word": false,
571
+ "special": true
572
+ },
573
+ "100327": {
574
+ "content": "<|unused_58|>",
575
+ "lstrip": false,
576
+ "normalized": false,
577
+ "rstrip": false,
578
+ "single_word": false,
579
+ "special": true
580
+ },
581
+ "100328": {
582
+ "content": "<|unused_59|>",
583
+ "lstrip": false,
584
+ "normalized": false,
585
+ "rstrip": false,
586
+ "single_word": false,
587
+ "special": true
588
+ },
589
+ "100329": {
590
+ "content": "<|unused_60|>",
591
+ "lstrip": false,
592
+ "normalized": false,
593
+ "rstrip": false,
594
+ "single_word": false,
595
+ "special": true
596
+ },
597
+ "100330": {
598
+ "content": "<|unused_61|>",
599
+ "lstrip": false,
600
+ "normalized": false,
601
+ "rstrip": false,
602
+ "single_word": false,
603
+ "special": true
604
+ },
605
+ "100331": {
606
+ "content": "<|unused_62|>",
607
+ "lstrip": false,
608
+ "normalized": false,
609
+ "rstrip": false,
610
+ "single_word": false,
611
+ "special": true
612
+ },
613
+ "100332": {
614
+ "content": "<|unused_63|>",
615
+ "lstrip": false,
616
+ "normalized": false,
617
+ "rstrip": false,
618
+ "single_word": false,
619
+ "special": true
620
+ },
621
+ "100333": {
622
+ "content": "<|unused_64|>",
623
+ "lstrip": false,
624
+ "normalized": false,
625
+ "rstrip": false,
626
+ "single_word": false,
627
+ "special": true
628
+ },
629
+ "100334": {
630
+ "content": "<|unused_65|>",
631
+ "lstrip": false,
632
+ "normalized": false,
633
+ "rstrip": false,
634
+ "single_word": false,
635
+ "special": true
636
+ },
637
+ "100335": {
638
+ "content": "<|unused_66|>",
639
+ "lstrip": false,
640
+ "normalized": false,
641
+ "rstrip": false,
642
+ "single_word": false,
643
+ "special": true
644
+ },
645
+ "100336": {
646
+ "content": "<|unused_67|>",
647
+ "lstrip": false,
648
+ "normalized": false,
649
+ "rstrip": false,
650
+ "single_word": false,
651
+ "special": true
652
+ },
653
+ "100337": {
654
+ "content": "<|unused_68|>",
655
+ "lstrip": false,
656
+ "normalized": false,
657
+ "rstrip": false,
658
+ "single_word": false,
659
+ "special": true
660
+ },
661
+ "100338": {
662
+ "content": "<|unused_69|>",
663
+ "lstrip": false,
664
+ "normalized": false,
665
+ "rstrip": false,
666
+ "single_word": false,
667
+ "special": true
668
+ },
669
+ "100339": {
670
+ "content": "<|unused_70|>",
671
+ "lstrip": false,
672
+ "normalized": false,
673
+ "rstrip": false,
674
+ "single_word": false,
675
+ "special": true
676
+ },
677
+ "100340": {
678
+ "content": "<|unused_71|>",
679
+ "lstrip": false,
680
+ "normalized": false,
681
+ "rstrip": false,
682
+ "single_word": false,
683
+ "special": true
684
+ },
685
+ "100341": {
686
+ "content": "<|unused_72|>",
687
+ "lstrip": false,
688
+ "normalized": false,
689
+ "rstrip": false,
690
+ "single_word": false,
691
+ "special": true
692
+ },
693
+ "100342": {
694
+ "content": "<|unused_73|>",
695
+ "lstrip": false,
696
+ "normalized": false,
697
+ "rstrip": false,
698
+ "single_word": false,
699
+ "special": true
700
+ },
701
+ "100343": {
702
+ "content": "<|unused_74|>",
703
+ "lstrip": false,
704
+ "normalized": false,
705
+ "rstrip": false,
706
+ "single_word": false,
707
+ "special": true
708
+ },
709
+ "100344": {
710
+ "content": "<|unused_75|>",
711
+ "lstrip": false,
712
+ "normalized": false,
713
+ "rstrip": false,
714
+ "single_word": false,
715
+ "special": true
716
+ },
717
+ "100345": {
718
+ "content": "<|unused_76|>",
719
+ "lstrip": false,
720
+ "normalized": false,
721
+ "rstrip": false,
722
+ "single_word": false,
723
+ "special": true
724
+ },
725
+ "100346": {
726
+ "content": "<|unused_77|>",
727
+ "lstrip": false,
728
+ "normalized": false,
729
+ "rstrip": false,
730
+ "single_word": false,
731
+ "special": true
732
+ },
733
+ "100347": {
734
+ "content": "<|unused_78|>",
735
+ "lstrip": false,
736
+ "normalized": false,
737
+ "rstrip": false,
738
+ "single_word": false,
739
+ "special": true
740
+ },
741
+ "100348": {
742
+ "content": "<|unused_79|>",
743
+ "lstrip": false,
744
+ "normalized": false,
745
+ "rstrip": false,
746
+ "single_word": false,
747
+ "special": true
748
+ },
749
+ "100349": {
750
+ "content": "<|unused_80|>",
751
+ "lstrip": false,
752
+ "normalized": false,
753
+ "rstrip": false,
754
+ "single_word": false,
755
+ "special": true
756
+ },
757
+ "100350": {
758
+ "content": "<|unused_81|>",
759
+ "lstrip": false,
760
+ "normalized": false,
761
+ "rstrip": false,
762
+ "single_word": false,
763
+ "special": true
764
+ },
765
+ "100351": {
766
+ "content": "<|unused_82|>",
767
+ "lstrip": false,
768
+ "normalized": false,
769
+ "rstrip": false,
770
+ "single_word": false,
771
+ "special": true
772
+ },
773
+ "100352": {
774
+ "content": "<image>",
775
+ "lstrip": false,
776
+ "normalized": false,
777
+ "rstrip": false,
778
+ "single_word": false,
779
+ "special": true
780
+ }
781
+ },
782
+ "additional_special_tokens": [
783
+ "<image>"
784
+ ],
785
+ "auto_map": {
786
+ "AutoProcessor": "processing.Granite4VisionProcessor"
787
+ },
788
+ "bos_token": "<|end_of_text|>",
789
+ "clean_up_tokenization_spaces": false,
790
+ "eos_token": "<|end_of_text|>",
791
+ "errors": "replace",
792
+ "extra_special_tokens": {},
793
+ "model_max_length": 1000000000000000019884624838656,
794
+ "pad_token": "<|pad|>",
795
+ "padding_side": "left",
796
+ "processor_class": "Granite4VisionProcessor",
797
+ "tokenizer_class": "GPT2Tokenizer",
798
+ "unk_token": "<|unk|>"
799
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff