sharpenb commited on
Commit
0bcace3
·
verified ·
1 Parent(s): 5760212

Upload folder using huggingface_hub (#1)

Browse files

- fb92c65167120a4c01d7c850a7775f225231c49d713a4addf6d503684df4e97c (c57bc2b485dd5fe19b003142cc161c29e2df84f8)

README.md ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ thumbnail: "https://assets-global.website-files.com/646b351987a8d8ce158d1940/64ec9e96b4334c0e1ac41504_Logo%20with%20white%20text.svg"
3
+ base_model: ucsahin/TraVisionLM-base
4
+ metrics:
5
+ - memory_disk
6
+ - memory_inference
7
+ - inference_latency
8
+ - inference_throughput
9
+ - inference_CO2_emissions
10
+ - inference_energy_consumption
11
+ tags:
12
+ - pruna-ai
13
+ ---
14
+ <!-- header start -->
15
+ <!-- 200823 -->
16
+ <div style="width: auto; margin-left: auto; margin-right: auto">
17
+ <a href="https://www.pruna.ai/" target="_blank" rel="noopener noreferrer">
18
+ <img src="https://i.imgur.com/eDAlcgk.png" alt="PrunaAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
19
+ </a>
20
+ </div>
21
+ <!-- header end -->
22
+
23
+ [![Twitter](https://img.shields.io/twitter/follow/PrunaAI?style=social)](https://twitter.com/PrunaAI)
24
+ [![GitHub](https://img.shields.io/github/followers/PrunaAI?label=Follow%20%40PrunaAI&style=social)](https://github.com/PrunaAI)
25
+ [![LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue)](https://www.linkedin.com/company/93832878/admin/feed/posts/?feedType=following)
26
+ [![Discord](https://img.shields.io/badge/Discord-Join%20Us-blue?style=social&logo=discord)](https://discord.gg/rskEr4BZJx)
27
+
28
+ # Simply make AI models cheaper, smaller, faster, and greener!
29
+
30
+ - Give a thumbs up if you like this model!
31
+ - Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
32
+ - Request access to easily compress your *own* AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
33
+ - Read the documentations to know more [here](https://pruna-ai-pruna.readthedocs-hosted.com/en/latest/)
34
+ - Join Pruna AI community on Discord [here](https://discord.gg/CP4VSgck) to share feedback/suggestions or get help.
35
+
36
+ ## Results
37
+
38
+ ![image info](./plots.png)
39
+
40
+ **Frequently Asked Questions**
41
+ - ***How does the compression work?*** The model is compressed with llm-int8.
42
+ - ***How does the model quality change?*** The quality of the model output might vary compared to the base model.
43
+ - ***How is the model efficiency evaluated?*** These results were obtained on HARDWARE_NAME with configuration described in `model/smash_config.json` and are obtained after a hardware warmup. The smashed model is directly compared to the original base model. Efficiency results may vary in other settings (e.g. other hardware, image size, batch size, ...). We recommend to directly run them in the use-case conditions to know if the smashed model can benefit you.
44
+ - ***What is the model format?*** We use safetensors.
45
+ - ***What calibration data has been used?*** If needed by the compression method, we used WikiText as the calibration data.
46
+ - ***What is the naming convention for Pruna Huggingface models?*** We take the original model name and append "turbo", "tiny", or "green" if the smashed model has a measured inference speed, inference memory, or inference energy consumption which is less than 90% of the original base model.
47
+ - ***How to compress my own models?*** You can request premium access to more compression methods and tech support for your specific use-cases [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
48
+ - ***What are "first" metrics?*** Results mentioning "first" are obtained after the first run of the model. The first run might take more memory or be slower than the subsequent runs due cuda overheads.
49
+ - ***What are "Sync" and "Async" metrics?*** "Sync" metrics are obtained by syncing all GPU processes and stop measurement when all of them are executed. "Async" metrics are obtained without syncing all GPU processes and stop when the model output can be used by the CPU. We provide both metrics since both could be relevant depending on the use-case. We recommend to test the efficiency gains directly in your use-cases.
50
+
51
+ ## Setup
52
+
53
+ You can run the smashed model with these steps:
54
+
55
+ 0. Check requirements from the original repo ucsahin/TraVisionLM-base installed. In particular, check python, cuda, and transformers versions.
56
+ 1. Make sure that you have installed quantization related packages.
57
+ ```bash
58
+ pip install transformers accelerate bitsandbytes>0.37.0
59
+ ```
60
+ 2. Load & run the model.
61
+ ```python
62
+ from transformers import AutoModelForCausalLM, AutoTokenizer
63
+
64
+
65
+ model = AutoModelForCausalLM.from_pretrained("PrunaAI/ucsahin-TraVisionLM-base-bnb-4bit-smashed", trust_remote_code=True, device_map='auto')
66
+ tokenizer = AutoTokenizer.from_pretrained("ucsahin/TraVisionLM-base")
67
+
68
+ input_ids = tokenizer("What is the color of prunes?,", return_tensors='pt').to(model.device)["input_ids"]
69
+
70
+ outputs = model.generate(input_ids, max_new_tokens=216)
71
+ tokenizer.decode(outputs[0])
72
+ ```
73
+
74
+ ## Configurations
75
+
76
+ The configuration info are in `smash_config.json`.
77
+
78
+ ## Credits & License
79
+
80
+ The license of the smashed model follows the license of the original model. Please check the license of the original model ucsahin/TraVisionLM-base before using this model which provided the base model. The license of the `pruna-engine` is [here](https://pypi.org/project/pruna-engine/) on Pypi.
81
+
82
+ ## Want to compress other models?
83
+
84
+ - Contact us and tell us which model to compress next [here](https://www.pruna.ai/contact).
85
+ - Request access to easily compress your own AI models [here](https://z0halsaff74.typeform.com/pruna-access?typeform-source=www.pruna.ai).
added_tokens.json ADDED
@@ -0,0 +1,1027 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<image>": 50257,
3
+ "<loc0000>": 50258,
4
+ "<loc0001>": 50259,
5
+ "<loc0002>": 50260,
6
+ "<loc0003>": 50261,
7
+ "<loc0004>": 50262,
8
+ "<loc0005>": 50263,
9
+ "<loc0006>": 50264,
10
+ "<loc0007>": 50265,
11
+ "<loc0008>": 50266,
12
+ "<loc0009>": 50267,
13
+ "<loc0010>": 50268,
14
+ "<loc0011>": 50269,
15
+ "<loc0012>": 50270,
16
+ "<loc0013>": 50271,
17
+ "<loc0014>": 50272,
18
+ "<loc0015>": 50273,
19
+ "<loc0016>": 50274,
20
+ "<loc0017>": 50275,
21
+ "<loc0018>": 50276,
22
+ "<loc0019>": 50277,
23
+ "<loc0020>": 50278,
24
+ "<loc0021>": 50279,
25
+ "<loc0022>": 50280,
26
+ "<loc0023>": 50281,
27
+ "<loc0024>": 50282,
28
+ "<loc0025>": 50283,
29
+ "<loc0026>": 50284,
30
+ "<loc0027>": 50285,
31
+ "<loc0028>": 50286,
32
+ "<loc0029>": 50287,
33
+ "<loc0030>": 50288,
34
+ "<loc0031>": 50289,
35
+ "<loc0032>": 50290,
36
+ "<loc0033>": 50291,
37
+ "<loc0034>": 50292,
38
+ "<loc0035>": 50293,
39
+ "<loc0036>": 50294,
40
+ "<loc0037>": 50295,
41
+ "<loc0038>": 50296,
42
+ "<loc0039>": 50297,
43
+ "<loc0040>": 50298,
44
+ "<loc0041>": 50299,
45
+ "<loc0042>": 50300,
46
+ "<loc0043>": 50301,
47
+ "<loc0044>": 50302,
48
+ "<loc0045>": 50303,
49
+ "<loc0046>": 50304,
50
+ "<loc0047>": 50305,
51
+ "<loc0048>": 50306,
52
+ "<loc0049>": 50307,
53
+ "<loc0050>": 50308,
54
+ "<loc0051>": 50309,
55
+ "<loc0052>": 50310,
56
+ "<loc0053>": 50311,
57
+ "<loc0054>": 50312,
58
+ "<loc0055>": 50313,
59
+ "<loc0056>": 50314,
60
+ "<loc0057>": 50315,
61
+ "<loc0058>": 50316,
62
+ "<loc0059>": 50317,
63
+ "<loc0060>": 50318,
64
+ "<loc0061>": 50319,
65
+ "<loc0062>": 50320,
66
+ "<loc0063>": 50321,
67
+ "<loc0064>": 50322,
68
+ "<loc0065>": 50323,
69
+ "<loc0066>": 50324,
70
+ "<loc0067>": 50325,
71
+ "<loc0068>": 50326,
72
+ "<loc0069>": 50327,
73
+ "<loc0070>": 50328,
74
+ "<loc0071>": 50329,
75
+ "<loc0072>": 50330,
76
+ "<loc0073>": 50331,
77
+ "<loc0074>": 50332,
78
+ "<loc0075>": 50333,
79
+ "<loc0076>": 50334,
80
+ "<loc0077>": 50335,
81
+ "<loc0078>": 50336,
82
+ "<loc0079>": 50337,
83
+ "<loc0080>": 50338,
84
+ "<loc0081>": 50339,
85
+ "<loc0082>": 50340,
86
+ "<loc0083>": 50341,
87
+ "<loc0084>": 50342,
88
+ "<loc0085>": 50343,
89
+ "<loc0086>": 50344,
90
+ "<loc0087>": 50345,
91
+ "<loc0088>": 50346,
92
+ "<loc0089>": 50347,
93
+ "<loc0090>": 50348,
94
+ "<loc0091>": 50349,
95
+ "<loc0092>": 50350,
96
+ "<loc0093>": 50351,
97
+ "<loc0094>": 50352,
98
+ "<loc0095>": 50353,
99
+ "<loc0096>": 50354,
100
+ "<loc0097>": 50355,
101
+ "<loc0098>": 50356,
102
+ "<loc0099>": 50357,
103
+ "<loc0100>": 50358,
104
+ "<loc0101>": 50359,
105
+ "<loc0102>": 50360,
106
+ "<loc0103>": 50361,
107
+ "<loc0104>": 50362,
108
+ "<loc0105>": 50363,
109
+ "<loc0106>": 50364,
110
+ "<loc0107>": 50365,
111
+ "<loc0108>": 50366,
112
+ "<loc0109>": 50367,
113
+ "<loc0110>": 50368,
114
+ "<loc0111>": 50369,
115
+ "<loc0112>": 50370,
116
+ "<loc0113>": 50371,
117
+ "<loc0114>": 50372,
118
+ "<loc0115>": 50373,
119
+ "<loc0116>": 50374,
120
+ "<loc0117>": 50375,
121
+ "<loc0118>": 50376,
122
+ "<loc0119>": 50377,
123
+ "<loc0120>": 50378,
124
+ "<loc0121>": 50379,
125
+ "<loc0122>": 50380,
126
+ "<loc0123>": 50381,
127
+ "<loc0124>": 50382,
128
+ "<loc0125>": 50383,
129
+ "<loc0126>": 50384,
130
+ "<loc0127>": 50385,
131
+ "<loc0128>": 50386,
132
+ "<loc0129>": 50387,
133
+ "<loc0130>": 50388,
134
+ "<loc0131>": 50389,
135
+ "<loc0132>": 50390,
136
+ "<loc0133>": 50391,
137
+ "<loc0134>": 50392,
138
+ "<loc0135>": 50393,
139
+ "<loc0136>": 50394,
140
+ "<loc0137>": 50395,
141
+ "<loc0138>": 50396,
142
+ "<loc0139>": 50397,
143
+ "<loc0140>": 50398,
144
+ "<loc0141>": 50399,
145
+ "<loc0142>": 50400,
146
+ "<loc0143>": 50401,
147
+ "<loc0144>": 50402,
148
+ "<loc0145>": 50403,
149
+ "<loc0146>": 50404,
150
+ "<loc0147>": 50405,
151
+ "<loc0148>": 50406,
152
+ "<loc0149>": 50407,
153
+ "<loc0150>": 50408,
154
+ "<loc0151>": 50409,
155
+ "<loc0152>": 50410,
156
+ "<loc0153>": 50411,
157
+ "<loc0154>": 50412,
158
+ "<loc0155>": 50413,
159
+ "<loc0156>": 50414,
160
+ "<loc0157>": 50415,
161
+ "<loc0158>": 50416,
162
+ "<loc0159>": 50417,
163
+ "<loc0160>": 50418,
164
+ "<loc0161>": 50419,
165
+ "<loc0162>": 50420,
166
+ "<loc0163>": 50421,
167
+ "<loc0164>": 50422,
168
+ "<loc0165>": 50423,
169
+ "<loc0166>": 50424,
170
+ "<loc0167>": 50425,
171
+ "<loc0168>": 50426,
172
+ "<loc0169>": 50427,
173
+ "<loc0170>": 50428,
174
+ "<loc0171>": 50429,
175
+ "<loc0172>": 50430,
176
+ "<loc0173>": 50431,
177
+ "<loc0174>": 50432,
178
+ "<loc0175>": 50433,
179
+ "<loc0176>": 50434,
180
+ "<loc0177>": 50435,
181
+ "<loc0178>": 50436,
182
+ "<loc0179>": 50437,
183
+ "<loc0180>": 50438,
184
+ "<loc0181>": 50439,
185
+ "<loc0182>": 50440,
186
+ "<loc0183>": 50441,
187
+ "<loc0184>": 50442,
188
+ "<loc0185>": 50443,
189
+ "<loc0186>": 50444,
190
+ "<loc0187>": 50445,
191
+ "<loc0188>": 50446,
192
+ "<loc0189>": 50447,
193
+ "<loc0190>": 50448,
194
+ "<loc0191>": 50449,
195
+ "<loc0192>": 50450,
196
+ "<loc0193>": 50451,
197
+ "<loc0194>": 50452,
198
+ "<loc0195>": 50453,
199
+ "<loc0196>": 50454,
200
+ "<loc0197>": 50455,
201
+ "<loc0198>": 50456,
202
+ "<loc0199>": 50457,
203
+ "<loc0200>": 50458,
204
+ "<loc0201>": 50459,
205
+ "<loc0202>": 50460,
206
+ "<loc0203>": 50461,
207
+ "<loc0204>": 50462,
208
+ "<loc0205>": 50463,
209
+ "<loc0206>": 50464,
210
+ "<loc0207>": 50465,
211
+ "<loc0208>": 50466,
212
+ "<loc0209>": 50467,
213
+ "<loc0210>": 50468,
214
+ "<loc0211>": 50469,
215
+ "<loc0212>": 50470,
216
+ "<loc0213>": 50471,
217
+ "<loc0214>": 50472,
218
+ "<loc0215>": 50473,
219
+ "<loc0216>": 50474,
220
+ "<loc0217>": 50475,
221
+ "<loc0218>": 50476,
222
+ "<loc0219>": 50477,
223
+ "<loc0220>": 50478,
224
+ "<loc0221>": 50479,
225
+ "<loc0222>": 50480,
226
+ "<loc0223>": 50481,
227
+ "<loc0224>": 50482,
228
+ "<loc0225>": 50483,
229
+ "<loc0226>": 50484,
230
+ "<loc0227>": 50485,
231
+ "<loc0228>": 50486,
232
+ "<loc0229>": 50487,
233
+ "<loc0230>": 50488,
234
+ "<loc0231>": 50489,
235
+ "<loc0232>": 50490,
236
+ "<loc0233>": 50491,
237
+ "<loc0234>": 50492,
238
+ "<loc0235>": 50493,
239
+ "<loc0236>": 50494,
240
+ "<loc0237>": 50495,
241
+ "<loc0238>": 50496,
242
+ "<loc0239>": 50497,
243
+ "<loc0240>": 50498,
244
+ "<loc0241>": 50499,
245
+ "<loc0242>": 50500,
246
+ "<loc0243>": 50501,
247
+ "<loc0244>": 50502,
248
+ "<loc0245>": 50503,
249
+ "<loc0246>": 50504,
250
+ "<loc0247>": 50505,
251
+ "<loc0248>": 50506,
252
+ "<loc0249>": 50507,
253
+ "<loc0250>": 50508,
254
+ "<loc0251>": 50509,
255
+ "<loc0252>": 50510,
256
+ "<loc0253>": 50511,
257
+ "<loc0254>": 50512,
258
+ "<loc0255>": 50513,
259
+ "<loc0256>": 50514,
260
+ "<loc0257>": 50515,
261
+ "<loc0258>": 50516,
262
+ "<loc0259>": 50517,
263
+ "<loc0260>": 50518,
264
+ "<loc0261>": 50519,
265
+ "<loc0262>": 50520,
266
+ "<loc0263>": 50521,
267
+ "<loc0264>": 50522,
268
+ "<loc0265>": 50523,
269
+ "<loc0266>": 50524,
270
+ "<loc0267>": 50525,
271
+ "<loc0268>": 50526,
272
+ "<loc0269>": 50527,
273
+ "<loc0270>": 50528,
274
+ "<loc0271>": 50529,
275
+ "<loc0272>": 50530,
276
+ "<loc0273>": 50531,
277
+ "<loc0274>": 50532,
278
+ "<loc0275>": 50533,
279
+ "<loc0276>": 50534,
280
+ "<loc0277>": 50535,
281
+ "<loc0278>": 50536,
282
+ "<loc0279>": 50537,
283
+ "<loc0280>": 50538,
284
+ "<loc0281>": 50539,
285
+ "<loc0282>": 50540,
286
+ "<loc0283>": 50541,
287
+ "<loc0284>": 50542,
288
+ "<loc0285>": 50543,
289
+ "<loc0286>": 50544,
290
+ "<loc0287>": 50545,
291
+ "<loc0288>": 50546,
292
+ "<loc0289>": 50547,
293
+ "<loc0290>": 50548,
294
+ "<loc0291>": 50549,
295
+ "<loc0292>": 50550,
296
+ "<loc0293>": 50551,
297
+ "<loc0294>": 50552,
298
+ "<loc0295>": 50553,
299
+ "<loc0296>": 50554,
300
+ "<loc0297>": 50555,
301
+ "<loc0298>": 50556,
302
+ "<loc0299>": 50557,
303
+ "<loc0300>": 50558,
304
+ "<loc0301>": 50559,
305
+ "<loc0302>": 50560,
306
+ "<loc0303>": 50561,
307
+ "<loc0304>": 50562,
308
+ "<loc0305>": 50563,
309
+ "<loc0306>": 50564,
310
+ "<loc0307>": 50565,
311
+ "<loc0308>": 50566,
312
+ "<loc0309>": 50567,
313
+ "<loc0310>": 50568,
314
+ "<loc0311>": 50569,
315
+ "<loc0312>": 50570,
316
+ "<loc0313>": 50571,
317
+ "<loc0314>": 50572,
318
+ "<loc0315>": 50573,
319
+ "<loc0316>": 50574,
320
+ "<loc0317>": 50575,
321
+ "<loc0318>": 50576,
322
+ "<loc0319>": 50577,
323
+ "<loc0320>": 50578,
324
+ "<loc0321>": 50579,
325
+ "<loc0322>": 50580,
326
+ "<loc0323>": 50581,
327
+ "<loc0324>": 50582,
328
+ "<loc0325>": 50583,
329
+ "<loc0326>": 50584,
330
+ "<loc0327>": 50585,
331
+ "<loc0328>": 50586,
332
+ "<loc0329>": 50587,
333
+ "<loc0330>": 50588,
334
+ "<loc0331>": 50589,
335
+ "<loc0332>": 50590,
336
+ "<loc0333>": 50591,
337
+ "<loc0334>": 50592,
338
+ "<loc0335>": 50593,
339
+ "<loc0336>": 50594,
340
+ "<loc0337>": 50595,
341
+ "<loc0338>": 50596,
342
+ "<loc0339>": 50597,
343
+ "<loc0340>": 50598,
344
+ "<loc0341>": 50599,
345
+ "<loc0342>": 50600,
346
+ "<loc0343>": 50601,
347
+ "<loc0344>": 50602,
348
+ "<loc0345>": 50603,
349
+ "<loc0346>": 50604,
350
+ "<loc0347>": 50605,
351
+ "<loc0348>": 50606,
352
+ "<loc0349>": 50607,
353
+ "<loc0350>": 50608,
354
+ "<loc0351>": 50609,
355
+ "<loc0352>": 50610,
356
+ "<loc0353>": 50611,
357
+ "<loc0354>": 50612,
358
+ "<loc0355>": 50613,
359
+ "<loc0356>": 50614,
360
+ "<loc0357>": 50615,
361
+ "<loc0358>": 50616,
362
+ "<loc0359>": 50617,
363
+ "<loc0360>": 50618,
364
+ "<loc0361>": 50619,
365
+ "<loc0362>": 50620,
366
+ "<loc0363>": 50621,
367
+ "<loc0364>": 50622,
368
+ "<loc0365>": 50623,
369
+ "<loc0366>": 50624,
370
+ "<loc0367>": 50625,
371
+ "<loc0368>": 50626,
372
+ "<loc0369>": 50627,
373
+ "<loc0370>": 50628,
374
+ "<loc0371>": 50629,
375
+ "<loc0372>": 50630,
376
+ "<loc0373>": 50631,
377
+ "<loc0374>": 50632,
378
+ "<loc0375>": 50633,
379
+ "<loc0376>": 50634,
380
+ "<loc0377>": 50635,
381
+ "<loc0378>": 50636,
382
+ "<loc0379>": 50637,
383
+ "<loc0380>": 50638,
384
+ "<loc0381>": 50639,
385
+ "<loc0382>": 50640,
386
+ "<loc0383>": 50641,
387
+ "<loc0384>": 50642,
388
+ "<loc0385>": 50643,
389
+ "<loc0386>": 50644,
390
+ "<loc0387>": 50645,
391
+ "<loc0388>": 50646,
392
+ "<loc0389>": 50647,
393
+ "<loc0390>": 50648,
394
+ "<loc0391>": 50649,
395
+ "<loc0392>": 50650,
396
+ "<loc0393>": 50651,
397
+ "<loc0394>": 50652,
398
+ "<loc0395>": 50653,
399
+ "<loc0396>": 50654,
400
+ "<loc0397>": 50655,
401
+ "<loc0398>": 50656,
402
+ "<loc0399>": 50657,
403
+ "<loc0400>": 50658,
404
+ "<loc0401>": 50659,
405
+ "<loc0402>": 50660,
406
+ "<loc0403>": 50661,
407
+ "<loc0404>": 50662,
408
+ "<loc0405>": 50663,
409
+ "<loc0406>": 50664,
410
+ "<loc0407>": 50665,
411
+ "<loc0408>": 50666,
412
+ "<loc0409>": 50667,
413
+ "<loc0410>": 50668,
414
+ "<loc0411>": 50669,
415
+ "<loc0412>": 50670,
416
+ "<loc0413>": 50671,
417
+ "<loc0414>": 50672,
418
+ "<loc0415>": 50673,
419
+ "<loc0416>": 50674,
420
+ "<loc0417>": 50675,
421
+ "<loc0418>": 50676,
422
+ "<loc0419>": 50677,
423
+ "<loc0420>": 50678,
424
+ "<loc0421>": 50679,
425
+ "<loc0422>": 50680,
426
+ "<loc0423>": 50681,
427
+ "<loc0424>": 50682,
428
+ "<loc0425>": 50683,
429
+ "<loc0426>": 50684,
430
+ "<loc0427>": 50685,
431
+ "<loc0428>": 50686,
432
+ "<loc0429>": 50687,
433
+ "<loc0430>": 50688,
434
+ "<loc0431>": 50689,
435
+ "<loc0432>": 50690,
436
+ "<loc0433>": 50691,
437
+ "<loc0434>": 50692,
438
+ "<loc0435>": 50693,
439
+ "<loc0436>": 50694,
440
+ "<loc0437>": 50695,
441
+ "<loc0438>": 50696,
442
+ "<loc0439>": 50697,
443
+ "<loc0440>": 50698,
444
+ "<loc0441>": 50699,
445
+ "<loc0442>": 50700,
446
+ "<loc0443>": 50701,
447
+ "<loc0444>": 50702,
448
+ "<loc0445>": 50703,
449
+ "<loc0446>": 50704,
450
+ "<loc0447>": 50705,
451
+ "<loc0448>": 50706,
452
+ "<loc0449>": 50707,
453
+ "<loc0450>": 50708,
454
+ "<loc0451>": 50709,
455
+ "<loc0452>": 50710,
456
+ "<loc0453>": 50711,
457
+ "<loc0454>": 50712,
458
+ "<loc0455>": 50713,
459
+ "<loc0456>": 50714,
460
+ "<loc0457>": 50715,
461
+ "<loc0458>": 50716,
462
+ "<loc0459>": 50717,
463
+ "<loc0460>": 50718,
464
+ "<loc0461>": 50719,
465
+ "<loc0462>": 50720,
466
+ "<loc0463>": 50721,
467
+ "<loc0464>": 50722,
468
+ "<loc0465>": 50723,
469
+ "<loc0466>": 50724,
470
+ "<loc0467>": 50725,
471
+ "<loc0468>": 50726,
472
+ "<loc0469>": 50727,
473
+ "<loc0470>": 50728,
474
+ "<loc0471>": 50729,
475
+ "<loc0472>": 50730,
476
+ "<loc0473>": 50731,
477
+ "<loc0474>": 50732,
478
+ "<loc0475>": 50733,
479
+ "<loc0476>": 50734,
480
+ "<loc0477>": 50735,
481
+ "<loc0478>": 50736,
482
+ "<loc0479>": 50737,
483
+ "<loc0480>": 50738,
484
+ "<loc0481>": 50739,
485
+ "<loc0482>": 50740,
486
+ "<loc0483>": 50741,
487
+ "<loc0484>": 50742,
488
+ "<loc0485>": 50743,
489
+ "<loc0486>": 50744,
490
+ "<loc0487>": 50745,
491
+ "<loc0488>": 50746,
492
+ "<loc0489>": 50747,
493
+ "<loc0490>": 50748,
494
+ "<loc0491>": 50749,
495
+ "<loc0492>": 50750,
496
+ "<loc0493>": 50751,
497
+ "<loc0494>": 50752,
498
+ "<loc0495>": 50753,
499
+ "<loc0496>": 50754,
500
+ "<loc0497>": 50755,
501
+ "<loc0498>": 50756,
502
+ "<loc0499>": 50757,
503
+ "<loc0500>": 50758,
504
+ "<loc0501>": 50759,
505
+ "<loc0502>": 50760,
506
+ "<loc0503>": 50761,
507
+ "<loc0504>": 50762,
508
+ "<loc0505>": 50763,
509
+ "<loc0506>": 50764,
510
+ "<loc0507>": 50765,
511
+ "<loc0508>": 50766,
512
+ "<loc0509>": 50767,
513
+ "<loc0510>": 50768,
514
+ "<loc0511>": 50769,
515
+ "<loc0512>": 50770,
516
+ "<loc0513>": 50771,
517
+ "<loc0514>": 50772,
518
+ "<loc0515>": 50773,
519
+ "<loc0516>": 50774,
520
+ "<loc0517>": 50775,
521
+ "<loc0518>": 50776,
522
+ "<loc0519>": 50777,
523
+ "<loc0520>": 50778,
524
+ "<loc0521>": 50779,
525
+ "<loc0522>": 50780,
526
+ "<loc0523>": 50781,
527
+ "<loc0524>": 50782,
528
+ "<loc0525>": 50783,
529
+ "<loc0526>": 50784,
530
+ "<loc0527>": 50785,
531
+ "<loc0528>": 50786,
532
+ "<loc0529>": 50787,
533
+ "<loc0530>": 50788,
534
+ "<loc0531>": 50789,
535
+ "<loc0532>": 50790,
536
+ "<loc0533>": 50791,
537
+ "<loc0534>": 50792,
538
+ "<loc0535>": 50793,
539
+ "<loc0536>": 50794,
540
+ "<loc0537>": 50795,
541
+ "<loc0538>": 50796,
542
+ "<loc0539>": 50797,
543
+ "<loc0540>": 50798,
544
+ "<loc0541>": 50799,
545
+ "<loc0542>": 50800,
546
+ "<loc0543>": 50801,
547
+ "<loc0544>": 50802,
548
+ "<loc0545>": 50803,
549
+ "<loc0546>": 50804,
550
+ "<loc0547>": 50805,
551
+ "<loc0548>": 50806,
552
+ "<loc0549>": 50807,
553
+ "<loc0550>": 50808,
554
+ "<loc0551>": 50809,
555
+ "<loc0552>": 50810,
556
+ "<loc0553>": 50811,
557
+ "<loc0554>": 50812,
558
+ "<loc0555>": 50813,
559
+ "<loc0556>": 50814,
560
+ "<loc0557>": 50815,
561
+ "<loc0558>": 50816,
562
+ "<loc0559>": 50817,
563
+ "<loc0560>": 50818,
564
+ "<loc0561>": 50819,
565
+ "<loc0562>": 50820,
566
+ "<loc0563>": 50821,
567
+ "<loc0564>": 50822,
568
+ "<loc0565>": 50823,
569
+ "<loc0566>": 50824,
570
+ "<loc0567>": 50825,
571
+ "<loc0568>": 50826,
572
+ "<loc0569>": 50827,
573
+ "<loc0570>": 50828,
574
+ "<loc0571>": 50829,
575
+ "<loc0572>": 50830,
576
+ "<loc0573>": 50831,
577
+ "<loc0574>": 50832,
578
+ "<loc0575>": 50833,
579
+ "<loc0576>": 50834,
580
+ "<loc0577>": 50835,
581
+ "<loc0578>": 50836,
582
+ "<loc0579>": 50837,
583
+ "<loc0580>": 50838,
584
+ "<loc0581>": 50839,
585
+ "<loc0582>": 50840,
586
+ "<loc0583>": 50841,
587
+ "<loc0584>": 50842,
588
+ "<loc0585>": 50843,
589
+ "<loc0586>": 50844,
590
+ "<loc0587>": 50845,
591
+ "<loc0588>": 50846,
592
+ "<loc0589>": 50847,
593
+ "<loc0590>": 50848,
594
+ "<loc0591>": 50849,
595
+ "<loc0592>": 50850,
596
+ "<loc0593>": 50851,
597
+ "<loc0594>": 50852,
598
+ "<loc0595>": 50853,
599
+ "<loc0596>": 50854,
600
+ "<loc0597>": 50855,
601
+ "<loc0598>": 50856,
602
+ "<loc0599>": 50857,
603
+ "<loc0600>": 50858,
604
+ "<loc0601>": 50859,
605
+ "<loc0602>": 50860,
606
+ "<loc0603>": 50861,
607
+ "<loc0604>": 50862,
608
+ "<loc0605>": 50863,
609
+ "<loc0606>": 50864,
610
+ "<loc0607>": 50865,
611
+ "<loc0608>": 50866,
612
+ "<loc0609>": 50867,
613
+ "<loc0610>": 50868,
614
+ "<loc0611>": 50869,
615
+ "<loc0612>": 50870,
616
+ "<loc0613>": 50871,
617
+ "<loc0614>": 50872,
618
+ "<loc0615>": 50873,
619
+ "<loc0616>": 50874,
620
+ "<loc0617>": 50875,
621
+ "<loc0618>": 50876,
622
+ "<loc0619>": 50877,
623
+ "<loc0620>": 50878,
624
+ "<loc0621>": 50879,
625
+ "<loc0622>": 50880,
626
+ "<loc0623>": 50881,
627
+ "<loc0624>": 50882,
628
+ "<loc0625>": 50883,
629
+ "<loc0626>": 50884,
630
+ "<loc0627>": 50885,
631
+ "<loc0628>": 50886,
632
+ "<loc0629>": 50887,
633
+ "<loc0630>": 50888,
634
+ "<loc0631>": 50889,
635
+ "<loc0632>": 50890,
636
+ "<loc0633>": 50891,
637
+ "<loc0634>": 50892,
638
+ "<loc0635>": 50893,
639
+ "<loc0636>": 50894,
640
+ "<loc0637>": 50895,
641
+ "<loc0638>": 50896,
642
+ "<loc0639>": 50897,
643
+ "<loc0640>": 50898,
644
+ "<loc0641>": 50899,
645
+ "<loc0642>": 50900,
646
+ "<loc0643>": 50901,
647
+ "<loc0644>": 50902,
648
+ "<loc0645>": 50903,
649
+ "<loc0646>": 50904,
650
+ "<loc0647>": 50905,
651
+ "<loc0648>": 50906,
652
+ "<loc0649>": 50907,
653
+ "<loc0650>": 50908,
654
+ "<loc0651>": 50909,
655
+ "<loc0652>": 50910,
656
+ "<loc0653>": 50911,
657
+ "<loc0654>": 50912,
658
+ "<loc0655>": 50913,
659
+ "<loc0656>": 50914,
660
+ "<loc0657>": 50915,
661
+ "<loc0658>": 50916,
662
+ "<loc0659>": 50917,
663
+ "<loc0660>": 50918,
664
+ "<loc0661>": 50919,
665
+ "<loc0662>": 50920,
666
+ "<loc0663>": 50921,
667
+ "<loc0664>": 50922,
668
+ "<loc0665>": 50923,
669
+ "<loc0666>": 50924,
670
+ "<loc0667>": 50925,
671
+ "<loc0668>": 50926,
672
+ "<loc0669>": 50927,
673
+ "<loc0670>": 50928,
674
+ "<loc0671>": 50929,
675
+ "<loc0672>": 50930,
676
+ "<loc0673>": 50931,
677
+ "<loc0674>": 50932,
678
+ "<loc0675>": 50933,
679
+ "<loc0676>": 50934,
680
+ "<loc0677>": 50935,
681
+ "<loc0678>": 50936,
682
+ "<loc0679>": 50937,
683
+ "<loc0680>": 50938,
684
+ "<loc0681>": 50939,
685
+ "<loc0682>": 50940,
686
+ "<loc0683>": 50941,
687
+ "<loc0684>": 50942,
688
+ "<loc0685>": 50943,
689
+ "<loc0686>": 50944,
690
+ "<loc0687>": 50945,
691
+ "<loc0688>": 50946,
692
+ "<loc0689>": 50947,
693
+ "<loc0690>": 50948,
694
+ "<loc0691>": 50949,
695
+ "<loc0692>": 50950,
696
+ "<loc0693>": 50951,
697
+ "<loc0694>": 50952,
698
+ "<loc0695>": 50953,
699
+ "<loc0696>": 50954,
700
+ "<loc0697>": 50955,
701
+ "<loc0698>": 50956,
702
+ "<loc0699>": 50957,
703
+ "<loc0700>": 50958,
704
+ "<loc0701>": 50959,
705
+ "<loc0702>": 50960,
706
+ "<loc0703>": 50961,
707
+ "<loc0704>": 50962,
708
+ "<loc0705>": 50963,
709
+ "<loc0706>": 50964,
710
+ "<loc0707>": 50965,
711
+ "<loc0708>": 50966,
712
+ "<loc0709>": 50967,
713
+ "<loc0710>": 50968,
714
+ "<loc0711>": 50969,
715
+ "<loc0712>": 50970,
716
+ "<loc0713>": 50971,
717
+ "<loc0714>": 50972,
718
+ "<loc0715>": 50973,
719
+ "<loc0716>": 50974,
720
+ "<loc0717>": 50975,
721
+ "<loc0718>": 50976,
722
+ "<loc0719>": 50977,
723
+ "<loc0720>": 50978,
724
+ "<loc0721>": 50979,
725
+ "<loc0722>": 50980,
726
+ "<loc0723>": 50981,
727
+ "<loc0724>": 50982,
728
+ "<loc0725>": 50983,
729
+ "<loc0726>": 50984,
730
+ "<loc0727>": 50985,
731
+ "<loc0728>": 50986,
732
+ "<loc0729>": 50987,
733
+ "<loc0730>": 50988,
734
+ "<loc0731>": 50989,
735
+ "<loc0732>": 50990,
736
+ "<loc0733>": 50991,
737
+ "<loc0734>": 50992,
738
+ "<loc0735>": 50993,
739
+ "<loc0736>": 50994,
740
+ "<loc0737>": 50995,
741
+ "<loc0738>": 50996,
742
+ "<loc0739>": 50997,
743
+ "<loc0740>": 50998,
744
+ "<loc0741>": 50999,
745
+ "<loc0742>": 51000,
746
+ "<loc0743>": 51001,
747
+ "<loc0744>": 51002,
748
+ "<loc0745>": 51003,
749
+ "<loc0746>": 51004,
750
+ "<loc0747>": 51005,
751
+ "<loc0748>": 51006,
752
+ "<loc0749>": 51007,
753
+ "<loc0750>": 51008,
754
+ "<loc0751>": 51009,
755
+ "<loc0752>": 51010,
756
+ "<loc0753>": 51011,
757
+ "<loc0754>": 51012,
758
+ "<loc0755>": 51013,
759
+ "<loc0756>": 51014,
760
+ "<loc0757>": 51015,
761
+ "<loc0758>": 51016,
762
+ "<loc0759>": 51017,
763
+ "<loc0760>": 51018,
764
+ "<loc0761>": 51019,
765
+ "<loc0762>": 51020,
766
+ "<loc0763>": 51021,
767
+ "<loc0764>": 51022,
768
+ "<loc0765>": 51023,
769
+ "<loc0766>": 51024,
770
+ "<loc0767>": 51025,
771
+ "<loc0768>": 51026,
772
+ "<loc0769>": 51027,
773
+ "<loc0770>": 51028,
774
+ "<loc0771>": 51029,
775
+ "<loc0772>": 51030,
776
+ "<loc0773>": 51031,
777
+ "<loc0774>": 51032,
778
+ "<loc0775>": 51033,
779
+ "<loc0776>": 51034,
780
+ "<loc0777>": 51035,
781
+ "<loc0778>": 51036,
782
+ "<loc0779>": 51037,
783
+ "<loc0780>": 51038,
784
+ "<loc0781>": 51039,
785
+ "<loc0782>": 51040,
786
+ "<loc0783>": 51041,
787
+ "<loc0784>": 51042,
788
+ "<loc0785>": 51043,
789
+ "<loc0786>": 51044,
790
+ "<loc0787>": 51045,
791
+ "<loc0788>": 51046,
792
+ "<loc0789>": 51047,
793
+ "<loc0790>": 51048,
794
+ "<loc0791>": 51049,
795
+ "<loc0792>": 51050,
796
+ "<loc0793>": 51051,
797
+ "<loc0794>": 51052,
798
+ "<loc0795>": 51053,
799
+ "<loc0796>": 51054,
800
+ "<loc0797>": 51055,
801
+ "<loc0798>": 51056,
802
+ "<loc0799>": 51057,
803
+ "<loc0800>": 51058,
804
+ "<loc0801>": 51059,
805
+ "<loc0802>": 51060,
806
+ "<loc0803>": 51061,
807
+ "<loc0804>": 51062,
808
+ "<loc0805>": 51063,
809
+ "<loc0806>": 51064,
810
+ "<loc0807>": 51065,
811
+ "<loc0808>": 51066,
812
+ "<loc0809>": 51067,
813
+ "<loc0810>": 51068,
814
+ "<loc0811>": 51069,
815
+ "<loc0812>": 51070,
816
+ "<loc0813>": 51071,
817
+ "<loc0814>": 51072,
818
+ "<loc0815>": 51073,
819
+ "<loc0816>": 51074,
820
+ "<loc0817>": 51075,
821
+ "<loc0818>": 51076,
822
+ "<loc0819>": 51077,
823
+ "<loc0820>": 51078,
824
+ "<loc0821>": 51079,
825
+ "<loc0822>": 51080,
826
+ "<loc0823>": 51081,
827
+ "<loc0824>": 51082,
828
+ "<loc0825>": 51083,
829
+ "<loc0826>": 51084,
830
+ "<loc0827>": 51085,
831
+ "<loc0828>": 51086,
832
+ "<loc0829>": 51087,
833
+ "<loc0830>": 51088,
834
+ "<loc0831>": 51089,
835
+ "<loc0832>": 51090,
836
+ "<loc0833>": 51091,
837
+ "<loc0834>": 51092,
838
+ "<loc0835>": 51093,
839
+ "<loc0836>": 51094,
840
+ "<loc0837>": 51095,
841
+ "<loc0838>": 51096,
842
+ "<loc0839>": 51097,
843
+ "<loc0840>": 51098,
844
+ "<loc0841>": 51099,
845
+ "<loc0842>": 51100,
846
+ "<loc0843>": 51101,
847
+ "<loc0844>": 51102,
848
+ "<loc0845>": 51103,
849
+ "<loc0846>": 51104,
850
+ "<loc0847>": 51105,
851
+ "<loc0848>": 51106,
852
+ "<loc0849>": 51107,
853
+ "<loc0850>": 51108,
854
+ "<loc0851>": 51109,
855
+ "<loc0852>": 51110,
856
+ "<loc0853>": 51111,
857
+ "<loc0854>": 51112,
858
+ "<loc0855>": 51113,
859
+ "<loc0856>": 51114,
860
+ "<loc0857>": 51115,
861
+ "<loc0858>": 51116,
862
+ "<loc0859>": 51117,
863
+ "<loc0860>": 51118,
864
+ "<loc0861>": 51119,
865
+ "<loc0862>": 51120,
866
+ "<loc0863>": 51121,
867
+ "<loc0864>": 51122,
868
+ "<loc0865>": 51123,
869
+ "<loc0866>": 51124,
870
+ "<loc0867>": 51125,
871
+ "<loc0868>": 51126,
872
+ "<loc0869>": 51127,
873
+ "<loc0870>": 51128,
874
+ "<loc0871>": 51129,
875
+ "<loc0872>": 51130,
876
+ "<loc0873>": 51131,
877
+ "<loc0874>": 51132,
878
+ "<loc0875>": 51133,
879
+ "<loc0876>": 51134,
880
+ "<loc0877>": 51135,
881
+ "<loc0878>": 51136,
882
+ "<loc0879>": 51137,
883
+ "<loc0880>": 51138,
884
+ "<loc0881>": 51139,
885
+ "<loc0882>": 51140,
886
+ "<loc0883>": 51141,
887
+ "<loc0884>": 51142,
888
+ "<loc0885>": 51143,
889
+ "<loc0886>": 51144,
890
+ "<loc0887>": 51145,
891
+ "<loc0888>": 51146,
892
+ "<loc0889>": 51147,
893
+ "<loc0890>": 51148,
894
+ "<loc0891>": 51149,
895
+ "<loc0892>": 51150,
896
+ "<loc0893>": 51151,
897
+ "<loc0894>": 51152,
898
+ "<loc0895>": 51153,
899
+ "<loc0896>": 51154,
900
+ "<loc0897>": 51155,
901
+ "<loc0898>": 51156,
902
+ "<loc0899>": 51157,
903
+ "<loc0900>": 51158,
904
+ "<loc0901>": 51159,
905
+ "<loc0902>": 51160,
906
+ "<loc0903>": 51161,
907
+ "<loc0904>": 51162,
908
+ "<loc0905>": 51163,
909
+ "<loc0906>": 51164,
910
+ "<loc0907>": 51165,
911
+ "<loc0908>": 51166,
912
+ "<loc0909>": 51167,
913
+ "<loc0910>": 51168,
914
+ "<loc0911>": 51169,
915
+ "<loc0912>": 51170,
916
+ "<loc0913>": 51171,
917
+ "<loc0914>": 51172,
918
+ "<loc0915>": 51173,
919
+ "<loc0916>": 51174,
920
+ "<loc0917>": 51175,
921
+ "<loc0918>": 51176,
922
+ "<loc0919>": 51177,
923
+ "<loc0920>": 51178,
924
+ "<loc0921>": 51179,
925
+ "<loc0922>": 51180,
926
+ "<loc0923>": 51181,
927
+ "<loc0924>": 51182,
928
+ "<loc0925>": 51183,
929
+ "<loc0926>": 51184,
930
+ "<loc0927>": 51185,
931
+ "<loc0928>": 51186,
932
+ "<loc0929>": 51187,
933
+ "<loc0930>": 51188,
934
+ "<loc0931>": 51189,
935
+ "<loc0932>": 51190,
936
+ "<loc0933>": 51191,
937
+ "<loc0934>": 51192,
938
+ "<loc0935>": 51193,
939
+ "<loc0936>": 51194,
940
+ "<loc0937>": 51195,
941
+ "<loc0938>": 51196,
942
+ "<loc0939>": 51197,
943
+ "<loc0940>": 51198,
944
+ "<loc0941>": 51199,
945
+ "<loc0942>": 51200,
946
+ "<loc0943>": 51201,
947
+ "<loc0944>": 51202,
948
+ "<loc0945>": 51203,
949
+ "<loc0946>": 51204,
950
+ "<loc0947>": 51205,
951
+ "<loc0948>": 51206,
952
+ "<loc0949>": 51207,
953
+ "<loc0950>": 51208,
954
+ "<loc0951>": 51209,
955
+ "<loc0952>": 51210,
956
+ "<loc0953>": 51211,
957
+ "<loc0954>": 51212,
958
+ "<loc0955>": 51213,
959
+ "<loc0956>": 51214,
960
+ "<loc0957>": 51215,
961
+ "<loc0958>": 51216,
962
+ "<loc0959>": 51217,
963
+ "<loc0960>": 51218,
964
+ "<loc0961>": 51219,
965
+ "<loc0962>": 51220,
966
+ "<loc0963>": 51221,
967
+ "<loc0964>": 51222,
968
+ "<loc0965>": 51223,
969
+ "<loc0966>": 51224,
970
+ "<loc0967>": 51225,
971
+ "<loc0968>": 51226,
972
+ "<loc0969>": 51227,
973
+ "<loc0970>": 51228,
974
+ "<loc0971>": 51229,
975
+ "<loc0972>": 51230,
976
+ "<loc0973>": 51231,
977
+ "<loc0974>": 51232,
978
+ "<loc0975>": 51233,
979
+ "<loc0976>": 51234,
980
+ "<loc0977>": 51235,
981
+ "<loc0978>": 51236,
982
+ "<loc0979>": 51237,
983
+ "<loc0980>": 51238,
984
+ "<loc0981>": 51239,
985
+ "<loc0982>": 51240,
986
+ "<loc0983>": 51241,
987
+ "<loc0984>": 51242,
988
+ "<loc0985>": 51243,
989
+ "<loc0986>": 51244,
990
+ "<loc0987>": 51245,
991
+ "<loc0988>": 51246,
992
+ "<loc0989>": 51247,
993
+ "<loc0990>": 51248,
994
+ "<loc0991>": 51249,
995
+ "<loc0992>": 51250,
996
+ "<loc0993>": 51251,
997
+ "<loc0994>": 51252,
998
+ "<loc0995>": 51253,
999
+ "<loc0996>": 51254,
1000
+ "<loc0997>": 51255,
1001
+ "<loc0998>": 51256,
1002
+ "<loc0999>": 51257,
1003
+ "<loc1000>": 51258,
1004
+ "<loc1001>": 51259,
1005
+ "<loc1002>": 51260,
1006
+ "<loc1003>": 51261,
1007
+ "<loc1004>": 51262,
1008
+ "<loc1005>": 51263,
1009
+ "<loc1006>": 51264,
1010
+ "<loc1007>": 51265,
1011
+ "<loc1008>": 51266,
1012
+ "<loc1009>": 51267,
1013
+ "<loc1010>": 51268,
1014
+ "<loc1011>": 51269,
1015
+ "<loc1012>": 51270,
1016
+ "<loc1013>": 51271,
1017
+ "<loc1014>": 51272,
1018
+ "<loc1015>": 51273,
1019
+ "<loc1016>": 51274,
1020
+ "<loc1017>": 51275,
1021
+ "<loc1018>": 51276,
1022
+ "<loc1019>": 51277,
1023
+ "<loc1020>": 51278,
1024
+ "<loc1021>": 51279,
1025
+ "<loc1022>": 51280,
1026
+ "<loc1023>": 51281
1027
+ }
config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/ceph/hdd/staff/charpent/.cache/modelsw6weqh39r8vdmibp",
3
+ "architectures": [
4
+ "TraVisionForCausalLM"
5
+ ],
6
+ "auto_map": {
7
+ "AutoConfig": "configuration_travisionlm.TraVisionLMConfig",
8
+ "AutoModelForCausalLM": "modeling_travisionlm.TraVisionForCausalLM"
9
+ },
10
+ "hidden_size": 1280,
11
+ "ignore_index": -100,
12
+ "image_token_index": 50257,
13
+ "model_type": "travisionlm",
14
+ "num_image_tokens": 256,
15
+ "projection_dim": 768,
16
+ "quantization_config": {
17
+ "_load_in_4bit": true,
18
+ "_load_in_8bit": false,
19
+ "bnb_4bit_compute_dtype": "bfloat16",
20
+ "bnb_4bit_quant_storage": "uint8",
21
+ "bnb_4bit_quant_type": "fp4",
22
+ "bnb_4bit_use_double_quant": false,
23
+ "llm_int8_enable_fp32_cpu_offload": false,
24
+ "llm_int8_has_fp16_weight": false,
25
+ "llm_int8_skip_modules": [
26
+ "lm_head"
27
+ ],
28
+ "llm_int8_threshold": 6.0,
29
+ "load_in_4bit": true,
30
+ "load_in_8bit": false,
31
+ "quant_method": "bitsandbytes"
32
+ },
33
+ "text_config": {
34
+ "architectures": [
35
+ "GPT2LMHeadModel"
36
+ ],
37
+ "bos_token_id": 0,
38
+ "eos_token_id": 0,
39
+ "model_type": "gpt2",
40
+ "n_ctx": 1024,
41
+ "n_embd": 1280,
42
+ "n_head": 20,
43
+ "n_layer": 36,
44
+ "pad_token_id": 0,
45
+ "reorder_and_upcast_attn": true,
46
+ "scale_attn_by_inverse_layer_idx": true,
47
+ "task_specific_params": {
48
+ "text-generation": {
49
+ "do_sample": true,
50
+ "max_length": 50
51
+ }
52
+ },
53
+ "torch_dtype": "float32",
54
+ "vocab_size": 51282
55
+ },
56
+ "torch_dtype": "float16",
57
+ "transformers_version": "4.42.4",
58
+ "vision_config": {
59
+ "image_size": 256,
60
+ "model_type": "siglip_vision_model",
61
+ "projection_dim": 768
62
+ }
63
+ }
configuration_travisionlm.py ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """TraVisionLM configuration"""
2
+
3
+ from transformers import PretrainedConfig
4
+ from transformers import logging, CONFIG_MAPPING
5
+ import warnings
6
+
7
+ logger = logging.get_logger(__name__)
8
+
9
+ class TraVisionLMConfig(PretrainedConfig):
10
+ model_type = "travisionlm"
11
+ is_composition = False
12
+
13
+ def __init__(
14
+ self,
15
+ vision_config=None,
16
+ text_config=None,
17
+ ignore_index=-100,
18
+ image_token_idx=50257,
19
+ vocab_size=51282,
20
+ projection_dim=768,
21
+ hidden_size=1280,
22
+ **kwargs,
23
+ ):
24
+ self.ignore_index = ignore_index
25
+ self.image_token_index = image_token_idx
26
+ self._vocab_size = vocab_size
27
+ self.projection_dim = projection_dim
28
+ self.hidden_size = hidden_size
29
+ self.vision_config = vision_config
30
+ self.is_encoder_decoder = False
31
+ if isinstance(self.vision_config, dict):
32
+ vision_config["model_type"] = (
33
+ vision_config["model_type"] if "model_type" in vision_config else "siglip_vision_model"
34
+ )
35
+ self.vision_config = CONFIG_MAPPING[vision_config["model_type"]](**vision_config)
36
+ elif vision_config is None:
37
+ self.vision_config = CONFIG_MAPPING["siglip_vision_model"](
38
+ attention_dropout=0.0,
39
+ hidden_act="gelu_pytorch_tanh",
40
+ hidden_size=768,
41
+ image_size=256,
42
+ intermediate_size=3072,
43
+ layer_norm_eps=1e-06,
44
+ num_attention_heads=12,
45
+ num_channels=3,
46
+ num_hidden_layers=12,
47
+ patch_size=16,
48
+ )
49
+ self.vocab_size = vocab_size
50
+
51
+ self.text_config = text_config
52
+
53
+ if isinstance(self.text_config, dict):
54
+ text_config["model_type"] = text_config["model_type"] if "model_type" in text_config else "gpt2"
55
+ self.text_config = CONFIG_MAPPING[text_config["model_type"]](**text_config)
56
+ elif text_config is None:
57
+ self.text_config = CONFIG_MAPPING["gpt2"](
58
+ activation_function="gelu_new",
59
+ attn_pdrop=0.1,
60
+ embd_pdrop=0.1,
61
+ initializer_range=0.02,
62
+ layer_norm_epsilon=1e-05,
63
+ n_ctx=1024,
64
+ n_embd=1280,
65
+ n_head=20,
66
+ n_layer=36,
67
+ n_positions=1024,
68
+ reorder_and_upcast_attn=False,
69
+ resid_pdrop=0.1,
70
+ scale_attn_by_inverse_layer_idx=False,
71
+ scale_attn_weights=True,
72
+ vocab_size=vocab_size
73
+ )
74
+ self.num_image_tokens = (self.vision_config.image_size // self.vision_config.patch_size) ** 2
75
+ self.pad_token_id = self.text_config.pad_token_id
76
+ self.vision_config.projection_dim = projection_dim
77
+ super().__init__(**kwargs)
78
+
79
+ @property
80
+ def vocab_size(self):
81
+ warnings.warn(
82
+ "The `vocab_size` attribute is deprecated and will be removed in v4.44, Please use `text_config.vocab_size` instead.",
83
+ FutureWarning,
84
+ )
85
+ return self._vocab_size
86
+
87
+ @vocab_size.setter
88
+ def vocab_size(self, value):
89
+ self._vocab_size = value
90
+
91
+ def to_dict(self):
92
+ output = super().to_dict()
93
+ output.pop("_vocab_size", None)
94
+ return output
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "eos_token_id": 0,
5
+ "pad_token_id": 0,
6
+ "transformers_version": "4.42.4"
7
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f51eca26aef3a597ddd3651fb74c8345e55feab743f2db4ad9645b6d649282c4
3
+ size 593123336
modeling_travisionlm.py ADDED
@@ -0,0 +1,520 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """PyTorch TraVisionLM"""
2
+ import torch
3
+ from transformers import PreTrainedModel, AutoModel, AutoModelForCausalLM
4
+ from transformers.utils import logging, add_start_docstrings, ModelOutput
5
+ from transformers.modeling_attn_mask_utils import _prepare_4d_causal_attention_mask_for_sdpa
6
+ from dataclasses import dataclass
7
+ from typing import List, Optional, Tuple, Union
8
+ from torch import nn
9
+ from transformers.cache_utils import Cache
10
+
11
+ logger = logging.get_logger(__name__)
12
+
13
+ from .configuration_travisionlm import TraVisionLMConfig
14
+
15
+ _CONFIG_FOR_DOC = "TraVisionLMConfig"
16
+
17
+ @dataclass
18
+ class TraVisionCausalLMOutputWithPast(ModelOutput):
19
+ """
20
+ Base class for TraVision language model (or autoregressive) outputs.
21
+
22
+ Args:
23
+ loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` is provided):
24
+ Language modeling loss (for next-token prediction).
25
+ logits (`torch.FloatTensor` of shape `(batch_size, sequence_length, config.vocab_size)`):
26
+ Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
27
+ past_key_values (`tuple(tuple(torch.FloatTensor))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
28
+ Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of shape
29
+ `(batch_size, num_heads, sequence_length, embed_size_per_head)`)
30
+
31
+ Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
32
+ `past_key_values` input) to speed up sequential decoding.
33
+ hidden_states (`tuple(torch.FloatTensor)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
34
+ Tuple of `torch.FloatTensor` (one for the output of the embeddings, if the model has an embedding layer, +
35
+ one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`.
36
+
37
+ Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.
38
+ attentions (`tuple(torch.FloatTensor)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
39
+ Tuple of `torch.FloatTensor` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
40
+ sequence_length)`.
41
+
42
+ Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
43
+ heads.
44
+ image_hidden_states (`tuple(torch.FloatTensor)`, *optional*):
45
+ Tuple of `torch.FloatTensor` (one for the output of the image embeddings, `(batch_size, num_images,
46
+ sequence_length, hidden_size)`.
47
+
48
+ image_hidden_states of the model produced by the vision encoder, and optionally by the perceiver
49
+ """
50
+ loss: Optional[torch.FloatTensor] = None
51
+ logits: torch.FloatTensor = None
52
+ past_key_values: Optional[Union[List[torch.FloatTensor], Cache]] = None
53
+ hidden_states: Optional[Tuple[torch.FloatTensor]] = None
54
+ attentions: Optional[Tuple[torch.FloatTensor]] = None
55
+ image_hidden_states: Optional[Tuple[torch.FloatTensor]] = None
56
+
57
+
58
+ class TraVisionMultiModalProjector(nn.Module):
59
+ """
60
+ Multimodal projector that cast the image features into the same dimension space as the language model
61
+ """
62
+ def __init__(self, config: TraVisionLMConfig, dropout=0.1):
63
+ super().__init__()
64
+ self.net = nn.Sequential(
65
+ nn.Linear(config.vision_config.projection_dim, 4*config.vision_config.projection_dim, bias=True),
66
+ nn.GELU(),
67
+ nn.Linear(4*config.vision_config.projection_dim, config.hidden_size, bias=True),
68
+ nn.Dropout(dropout)
69
+ )
70
+
71
+ def forward(self, image_features):
72
+ hidden_states = self.net(image_features).to(image_features.dtype)
73
+ return hidden_states
74
+
75
+
76
+ TRAVISIONLM_START_DOCSTRING = r"""
77
+ This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
78
+ library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
79
+ etc.)
80
+
81
+ This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
82
+ Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
83
+ and behavior.
84
+
85
+ Parameters:
86
+ config ([`TraVisionLMConfig`]):
87
+ Model configuration class with all the parameters of the model. Initializing with a config file does not
88
+ load the weights associated with the model, only the configuration. Check out the
89
+ [`~PreTrainedModel.from_pretrained`] method to load the model weights.
90
+ """
91
+
92
+ @add_start_docstrings(
93
+ "The bare TraVision Model outputting raw hidden-states without any specific head on top.",
94
+ TRAVISIONLM_START_DOCSTRING,
95
+ )
96
+
97
+ class TraVisionPreTrainedModel(PreTrainedModel):
98
+ config_class = TraVisionLMConfig
99
+ base_model_prefix = "model"
100
+ supports_gradient_checkpointing = True
101
+ _no_split_modules = ["TraVisionMultiModalProjector"]
102
+ _skip_keys_device_placement = "past_key_values"
103
+ _supports_flash_attn_2 = True
104
+ _supports_sdpa = True
105
+
106
+ def _init_weights(self, module):
107
+ # Do NOT init the weights of the model using this class call, this is a ported version,
108
+ # hence not intended to be trained from scratch.
109
+ std = (
110
+ self.config.initializer_range
111
+ if hasattr(self.config, "initializer_range")
112
+ else self.config.text_config.initializer_range
113
+ )
114
+
115
+ if hasattr(module, "class_embedding"):
116
+ module.class_embedding.data.normal_(mean=0.0, std=std)
117
+
118
+ if isinstance(module, (nn.Linear, nn.Conv2d)):
119
+ module.weight.data.normal_(mean=0.0, std=std)
120
+ if module.bias is not None:
121
+ module.bias.data.zero_()
122
+ elif isinstance(module, nn.Embedding):
123
+ module.weight.data.normal_(mean=0.0, std=std)
124
+ if module.padding_idx is not None:
125
+ module.weight.data[module.padding_idx].zero_()
126
+
127
+ @property
128
+ def _supports_sdpa(self):
129
+ """
130
+ Retrieve language_model's attribute to check whether the model supports
131
+ SDPA or not.
132
+ """
133
+ return self.language_model._supports_sdpa
134
+
135
+
136
+ @add_start_docstrings(
137
+ """The TraVisionLM model which consists of a vision backbone and a language model.""",
138
+ TRAVISIONLM_START_DOCSTRING,
139
+ )
140
+ class TraVisionForCausalLM(TraVisionPreTrainedModel):
141
+ def __init__(self, config: TraVisionLMConfig):
142
+ super(TraVisionForCausalLM, self).__init__(config)
143
+ self.vocab_size = config.vocab_size
144
+ self.pad_token_id = -1 if config.pad_token_id == None else config.pad_token_id
145
+ self._attn_implementation = config._attn_implementation
146
+ self.gradient_checkpointing = False
147
+
148
+ self.vision_tower = AutoModel.from_config(config=config.vision_config)
149
+ self.vision_projector = TraVisionMultiModalProjector(config)
150
+
151
+ language_model = AutoModelForCausalLM.from_config(
152
+ config=config.text_config, attn_implementation=self._attn_implementation
153
+ )
154
+
155
+ if language_model._tied_weights_keys is not None:
156
+ self._tied_weights_keys = [f"language_model.{k}" for k in language_model._tied_weights_keys]
157
+
158
+ self.language_model = language_model
159
+
160
+ self.post_init()
161
+
162
+ # Copied from transformers.models.paligemma.modeling_paligemma.PaliGemmaForConditionalGeneration.get_input_embeddings with PaliGemma->TraVisionLM
163
+ def get_input_embeddings(self):
164
+ return self.language_model.get_input_embeddings()
165
+
166
+ # Copied from transformers.models.paligemma.modeling_paligemma.PaliGemmaForConditionalGeneration.set_input_embeddings with PaliGemma->TraVisionLM
167
+ def set_input_embeddings(self, value):
168
+ self.language_model.set_input_embeddings(value)
169
+
170
+ # Copied from transformers.models.paligemma.modeling_paligemma.PaliGemmaForConditionalGeneration.get_output_embeddings with PaliGemma->TraVisionLM
171
+ def get_output_embeddings(self):
172
+ return self.language_model.get_output_embeddings()
173
+
174
+ # Copied from transformers.models.paligemma.modeling_paligemma.PaliGemmaForConditionalGeneration.set_output_embeddings with PaliGemma->TraVisionLM
175
+ def set_output_embeddings(self, new_embeddings):
176
+ self.language_model.set_output_embeddings(new_embeddings)
177
+
178
+ # Copied from transformers.models.paligemma.modeling_paligemma.PaliGemmaForConditionalGeneration.set_decoder with PaliGemma->TraVisionLM
179
+ def set_decoder(self, decoder):
180
+ self.language_model.set_decoder(decoder)
181
+
182
+ # Copied from transformers.models.paligemma.modeling_paligemma.PaliGemmaForConditionalGeneration.get_decoder with PaliGemma->TraVisionLM
183
+ def get_decoder(self):
184
+ return self.language_model.get_decoder()
185
+
186
+ # Copied from transformers.models.paligemma.modeling_paligemma.PaliGemmaForConditionalGeneration.tie_weights with PaliGemma->TraVisionLM
187
+ def tie_weights(self):
188
+ return self.language_model.tie_weights()
189
+
190
+ def resize_token_embeddings(self, new_num_tokens: Optional[int] = None, pad_to_multiple_of=None) -> nn.Embedding:
191
+ # TODO: config.vocab_size is deprecated and will be removed in v4.43.
192
+ # `resize_token_embeddings` should work from `modeling_utils.py``
193
+ model_embeds = self.language_model.resize_token_embeddings(new_num_tokens, pad_to_multiple_of)
194
+ self.config.text_config.vocab_size = model_embeds.num_embeddings
195
+ self.config.vocab_size = model_embeds.num_embeddings
196
+ self.vocab_size = model_embeds.num_embeddings
197
+ return model_embeds
198
+
199
+ # Copied from transformers.models.paligemma.modeling_paligemma.PaliGemmaForConditionalGeneration._merge_input_ids_with_image_features with PaliGemma->TraVisionLM
200
+ """ !!! Two significant modifications are made to the original code:
201
+ ------> 1) The pad and eos tokens are set to be the same in TraVisionProcessor. Hence, only the features corresponding to the padding mask are filtered out
202
+ using the attention mask.
203
+ ------> 2) The features corresponding to both the prompts (called prefixes in PaliGemma) and labels (called suffixes in PaliGemma) are added the final embedding tensor
204
+ and the tokens of both the prompts and labels are applied causal attention mask. All the image tokens are attended using full-attention mask.
205
+ NOTE: In the original PaliGemma implementation, only the suffix tokens are applied causal masking. Check out [PaliGemma arXiv Paper](https://arxiv.org/pdf/2407.07726)
206
+ for the details.
207
+ """
208
+ def _merge_input_ids_with_image_features(
209
+ self, image_features, inputs_embeds, input_ids, attention_mask, labels, token_type_ids, cache_position
210
+ ):
211
+ _, _, embed_dim = image_features.shape
212
+ batch_size, sequence_length = input_ids.shape
213
+ dtype, device = inputs_embeds.dtype, inputs_embeds.device
214
+ min_dtype = torch.finfo(dtype).min
215
+
216
+ scaled_image_features = image_features / (self.config.hidden_size**0.5)
217
+ final_embedding = torch.zeros(
218
+ batch_size, sequence_length, embed_dim, dtype=inputs_embeds.dtype, device=inputs_embeds.device
219
+ )
220
+
221
+ text_mask = (input_ids != self.config.image_token_index) & (attention_mask | input_ids != self.config.text_config.pad_token_id)
222
+ image_mask = input_ids == self.config.image_token_index
223
+ pad_mask = (attention_mask == 0) & (input_ids == self.config.text_config.pad_token_id)
224
+
225
+ # expand masks to match embedding dimension
226
+ text_mask_expanded = text_mask.unsqueeze(-1).expand(-1, -1, embed_dim).to(inputs_embeds.device)
227
+ pad_mask_expanded = pad_mask.unsqueeze(-1).expand(-1, -1, embed_dim).to(inputs_embeds.device)
228
+ # insert padding and text token embeddings
229
+ final_embedding = torch.where(text_mask_expanded, inputs_embeds, final_embedding)
230
+ final_embedding = torch.where(pad_mask_expanded, torch.zeros_like(final_embedding), final_embedding)
231
+ # insert image embeddings - the image mask is always less or equal to the sentence in length
232
+ final_embedding = final_embedding.masked_scatter(
233
+ image_mask.unsqueeze(-1).expand_as(final_embedding).to(device=final_embedding.device),
234
+ scaled_image_features.to(device=final_embedding.device, dtype=final_embedding.dtype),
235
+ )
236
+ final_embedding = torch.where(pad_mask_expanded, torch.zeros_like(final_embedding), final_embedding)
237
+ if attention_mask is not None:
238
+ position_ids = (attention_mask.cumsum(-1)).masked_fill_((attention_mask == 0), 1)
239
+ else:
240
+ position_ids = None
241
+
242
+ if token_type_ids is not None:
243
+ # we are training thus we need to create a full mask on the image, but causal on prompt and suffix
244
+ target_length = cache_position[-1] + 1
245
+ causal_mask = torch.full(
246
+ (sequence_length, target_length), fill_value=min_dtype, dtype=dtype, device=device
247
+ )
248
+ if sequence_length != 1:
249
+ causal_mask = torch.triu(causal_mask, diagonal=1)
250
+ causal_mask *= torch.arange(target_length, device=device) > cache_position.reshape(-1, 1)
251
+ causal_mask = causal_mask[None, None, :, :].expand(inputs_embeds.shape[0], 1, -1, -1)
252
+ if attention_mask is not None:
253
+ causal_mask = causal_mask.clone() # copy to contiguous memory for in-place edit
254
+ mask_length = attention_mask.shape[-1]
255
+ padding_mask = causal_mask[:, :, :, :mask_length] + attention_mask[:, None, None, :].to(
256
+ causal_mask.device
257
+ )
258
+ # unmask the prefill
259
+ causal_mask[:, :, :, :mask_length] = causal_mask[:, :, :, :mask_length].masked_fill(
260
+ token_type_ids[:, None, None, :].to(causal_mask.device) == 0, 0
261
+ )
262
+ padding_mask = padding_mask == 0
263
+ causal_mask[:, :, :, :mask_length] = causal_mask[:, :, :, :mask_length].masked_fill(
264
+ padding_mask, min_dtype
265
+ )
266
+
267
+ final_labels = None
268
+ if labels is not None:
269
+ final_labels = torch.full(
270
+ (batch_size, sequence_length), self.config.ignore_index, dtype=input_ids.dtype, device=input_ids.device
271
+ )
272
+ final_labels = torch.where((attention_mask | input_ids != self.config.text_config.pad_token_id), labels, final_labels)
273
+ else:
274
+ causal_mask = attention_mask.unsqueeze(1).unsqueeze(2) * attention_mask.unsqueeze(1).unsqueeze(-1)
275
+ # invert causal mask
276
+ causal_mask = torch.where(causal_mask == 0, min_dtype, 0).to(dtype)
277
+ final_labels = None
278
+
279
+ return final_embedding, causal_mask, final_labels, position_ids
280
+
281
+
282
+ def forward(
283
+ self,
284
+ input_ids: torch.LongTensor = None,
285
+ pixel_values: torch.FloatTensor = None,
286
+ attention_mask: Optional[torch.Tensor] = None,
287
+ position_ids: Optional[torch.LongTensor] = None,
288
+ past_key_values: Optional[Union[List[torch.FloatTensor], Cache]] = None,
289
+ token_type_ids: Optional[torch.LongTensor] = None,
290
+ cache_position: Optional[torch.LongTensor] = None,
291
+ inputs_embeds: Optional[torch.FloatTensor] = None,
292
+ labels: Optional[torch.LongTensor] = None,
293
+ use_cache: Optional[bool] = None,
294
+ output_attentions: Optional[bool] = None,
295
+ output_hidden_states: Optional[bool] = None,
296
+ return_dict: Optional[bool] = None,
297
+ ) -> Union[Tuple, TraVisionCausalLMOutputWithPast]:
298
+
299
+ if labels is not None:
300
+ use_cache = False
301
+
302
+ if input_ids is not None and inputs_embeds is not None:
303
+ raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time")
304
+ elif input_ids is not None:
305
+ self.warn_if_padding_and_no_attention_mask(input_ids, attention_mask)
306
+ input_shape = input_ids.size()
307
+ input_ids = input_ids.view(-1, input_shape[-1])
308
+ batch_size = input_ids.shape[0]
309
+ elif inputs_embeds is not None:
310
+ input_shape = inputs_embeds.size()[:-1]
311
+ batch_size = inputs_embeds.shape[0]
312
+ else:
313
+ raise ValueError("You have to specify either input_ids or inputs_embeds")
314
+
315
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
316
+ output_hidden_states = (
317
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
318
+ )
319
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
320
+
321
+ if past_key_values is None:
322
+ past_length = 0
323
+ past_key_values = tuple([None] * len(self.language_model.transformer.h))
324
+ else:
325
+ past_length = past_key_values[0][0].size(-2)
326
+ if position_ids is None:
327
+ position_ids = torch.arange(past_length, input_shape[-1] + past_length, dtype=torch.long, device=input_ids.device if input_ids is not None else inputs_embeds.device)
328
+ position_ids = position_ids.unsqueeze(0)
329
+
330
+ # the attention mask is turned 4d after, we keep track of the original one
331
+ input_attention_mask = attention_mask
332
+
333
+ if inputs_embeds is None:
334
+ # 1. Extract the input embeddings
335
+ inputs_embeds = self.get_input_embeddings()(input_ids)
336
+
337
+ # 2. Add the absolute positional embeddings to only text token locations in inputs_embeds
338
+ if pixel_values is not None and inputs_embeds.shape[1] != 1:
339
+ # Compute the initial mask for position IDs
340
+ position_ids_mask = torch.where(input_ids != self.config.image_token_index, position_ids, 1)
341
+ # Update the mask for positions where input_ids is not zero
342
+ position_ids_mask[:, :-1] = torch.where(input_ids[:, :-1] != 0, position_ids_mask[:, :-1], 1)
343
+ # Find the first position embedding locations
344
+ first_position_embed_locs = torch.sum(position_ids_mask == 1, dim=1)
345
+ # Adjust the mask by subtracting the first position embedding locations
346
+ position_ids_mask.sub_(first_position_embed_locs[:, None])
347
+ # Ensure all values in the mask are non-negative --> assign values 1 to pad and image token locations
348
+ position_emb_ids = torch.where(position_ids_mask >= 0, position_ids_mask, 1)
349
+ # construct position embeddings using position_emb_ids
350
+ position_embeds = self.language_model.transformer.wpe(position_emb_ids)
351
+ else:
352
+ # In this case, we generate from cache with past_key_values
353
+ pos_emb_ind = position_ids.view(batch_size, -1)
354
+ position_embeds = self.language_model.transformer.wpe(pos_emb_ind)
355
+
356
+ # Directly add position_embeds to inputs_embeds to get hidden_states
357
+ hidden_states = inputs_embeds + position_embeds
358
+
359
+ # 3. Merge text and images
360
+ if pixel_values is not None and input_ids.shape[1] != 1:
361
+ # make sure that pixel values are of 4D dimensions (batch_size, num_channels, width, height)
362
+ if pixel_values.dim() == 3:
363
+ pixel_values = pixel_values.unsqueeze(dim=0)
364
+
365
+ image_outputs = self.vision_tower(pixel_values.to(inputs_embeds.dtype))
366
+ selected_image_feature = image_outputs.last_hidden_state
367
+ image_features = self.vision_projector(selected_image_feature)
368
+
369
+ if cache_position is None:
370
+ cache_position = torch.arange(inputs_embeds.shape[1], device=inputs_embeds.device)
371
+ hidden_states, attention_mask, labels, _ = self._merge_input_ids_with_image_features(
372
+ image_features, hidden_states, input_ids, attention_mask, labels, token_type_ids, cache_position
373
+ )
374
+
375
+ else:
376
+ # In case input_ids.shape[1] == 1 & pixel_values==None & past_key_values != None, we are in the case of
377
+ # generation with cache, we can use standard causal masking
378
+ if past_key_values is not None and pixel_values is not None and input_ids.shape[1] == 1:
379
+ # Attention mask.
380
+ _use_sdpa = self._attn_implementation == "sdpa" and output_attentions is False
381
+ if attention_mask is not None:
382
+ attention_mask = attention_mask.view(batch_size, -1)
383
+ if self._attn_implementation == "flash_attention_2":
384
+ attention_mask = attention_mask if 0 in attention_mask else None
385
+ elif _use_sdpa:
386
+ attention_mask = _prepare_4d_causal_attention_mask_for_sdpa(
387
+ attention_mask=attention_mask,
388
+ input_shape=(batch_size, input_shape[-1]),
389
+ inputs_embeds=inputs_embeds,
390
+ past_key_values_length=past_length,
391
+ )
392
+ else:
393
+ # We create a 3D attention mask from a 2D tensor mask.
394
+ # Sizes are [batch_size, 1, 1, to_seq_length]
395
+ # So we can broadcast to [batch_size, num_heads, from_seq_length, to_seq_length]
396
+ # this attention mask is more simple than the triangular masking of causal attention
397
+ # used in OpenAI GPT, we just need to prepare the broadcast dimension here.
398
+ attention_mask = attention_mask[:, None, None, :]
399
+
400
+ # Since attention_mask is 1.0 for positions we want to attend and 0.0 for
401
+ # masked positions, this operation will create a tensor which is 0.0 for
402
+ # positions we want to attend and the dtype's smallest value for masked positions.
403
+ # Since we are adding it to the raw scores before the softmax, this is
404
+ # effectively the same as removing these entirely.
405
+ attention_mask = attention_mask.to(dtype=self.dtype) # fp16 compatibility
406
+ attention_mask = (1.0 - attention_mask) * torch.finfo(self.dtype).min
407
+
408
+ if attention_mask is not None:
409
+ attention_mask = attention_mask.to(inputs_embeds.dtype)
410
+
411
+ hidden_states = self.language_model.transformer.drop(hidden_states)
412
+ output_shape = (-1,) + input_shape[1:] + (hidden_states.size(-1),)
413
+
414
+ presents = () if use_cache else None
415
+ all_self_attentions = () if output_attentions else None
416
+ all_hidden_states = () if output_hidden_states else None
417
+ for i, (block, layer_past) in enumerate(zip(self.language_model.transformer.h, past_key_values)):
418
+ if output_hidden_states:
419
+ all_hidden_states = all_hidden_states + (hidden_states,)
420
+ outputs = block(
421
+ hidden_states,
422
+ layer_past=layer_past,
423
+ attention_mask=attention_mask,
424
+ use_cache=use_cache,
425
+ output_attentions=output_attentions,
426
+ )
427
+ hidden_states = outputs[0]
428
+ if use_cache is True:
429
+ presents = presents + (outputs[1],)
430
+
431
+ if output_attentions:
432
+ all_self_attentions = all_self_attentions + (outputs[2 if use_cache else 1],)
433
+
434
+ hidden_states = self.language_model.transformer.ln_f(hidden_states)
435
+
436
+ hidden_states = hidden_states.view(output_shape)
437
+ # Add last hidden state
438
+ if output_hidden_states:
439
+ all_hidden_states = all_hidden_states + (hidden_states,)
440
+
441
+ logits = self.language_model.lm_head(hidden_states)
442
+ logits = logits.float()
443
+ loss = None
444
+ if labels is not None:
445
+ shift_logits = logits[..., :-1, :]
446
+ shift_labels = labels[..., 1:] # shift to right
447
+ if input_attention_mask is not None:
448
+ # we use the input attention mask to shift the logits and labels, because it is 2D.
449
+ shift_attention_mask = input_attention_mask[..., 1:]
450
+ shift_logits = shift_logits[shift_attention_mask.to(logits.device) != 0].contiguous()
451
+ shift_labels = shift_labels[shift_attention_mask.to(shift_labels.device) != 0].contiguous()
452
+ else:
453
+ shift_logits = shift_logits.contiguous()
454
+ shift_labels = shift_labels.contiguous()
455
+ # Flatten the tokens
456
+ loss_fct = nn.CrossEntropyLoss()
457
+
458
+ flat_logits = shift_logits.view(-1, self.config.vocab_size)
459
+ flat_labels = shift_labels.view(-1).to(shift_logits.device)
460
+ loss = loss_fct(flat_logits, flat_labels)
461
+ if not return_dict:
462
+ output = (logits, presents, all_hidden_states, all_self_attentions)
463
+ return (loss,) + output if loss is not None else output
464
+
465
+ return TraVisionCausalLMOutputWithPast(
466
+ loss=loss,
467
+ logits=logits,
468
+ past_key_values=presents,
469
+ hidden_states=all_hidden_states,
470
+ attentions=all_self_attentions,
471
+ )
472
+
473
+ def prepare_inputs_for_generation(
474
+ self,
475
+ input_ids,
476
+ past_key_values=None,
477
+ inputs_embeds=None,
478
+ cache_position=None,
479
+ position_ids=None,
480
+ pixel_values=None,
481
+ attention_mask=None,
482
+ token_type_ids=None,
483
+ use_cache=True,
484
+ **kwargs,
485
+ ):
486
+ # set position inds here: we are going to use absolute position embeddings, hence carefully track the locs of the past position embedding indices
487
+ if attention_mask is not None and position_ids is None:
488
+ if past_key_values:
489
+ position_ids_mask = (input_ids != self.config.image_token_index)
490
+ position_ids_mask[:, :-1] &= (input_ids[:, :-1] != self.config.text_config.pad_token_id)
491
+ last_index = position_ids_mask.sum(dim=1) - 1
492
+ position_ids = torch.stack([torch.arange(start, start+cache_position.shape[0], device=input_ids.device) for start in last_index])
493
+
494
+ # If we have cache: let's slice `input_ids` through `cache_position`, to keep only the unprocessed tokens
495
+ # Exception 1: when passing input_embeds, input_ids may be missing entries
496
+ # Exception 2: some generation methods do special slicing of input_ids, so we don't need to do it here
497
+ if past_key_values is not None:
498
+ if inputs_embeds is not None: # Exception 1
499
+ input_ids = input_ids[:, -cache_position.shape[0] :]
500
+ elif input_ids.shape[1] != cache_position.shape[0]: # Default case (the "else", a no op, is Exception 2)
501
+ input_ids = input_ids[:, cache_position]
502
+
503
+ # if `inputs_embeds` are passed, we only want to use them in the 1st generation step
504
+ if inputs_embeds is not None and cache_position[0] == 0:
505
+ model_inputs = {"inputs_embeds": inputs_embeds}
506
+ else:
507
+ model_inputs = {"input_ids": input_ids.contiguous()} # `contiguous()` needed for compilation use cases
508
+
509
+ model_inputs.update(
510
+ {
511
+ "position_ids": position_ids,
512
+ "past_key_values": past_key_values,
513
+ "cache_position": cache_position,
514
+ "use_cache": use_cache,
515
+ "attention_mask": attention_mask,
516
+ "pixel_values": pixel_values,
517
+ "token_type_ids": token_type_ids,
518
+ }
519
+ )
520
+ return model_inputs
smash_config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "api_key": null,
3
+ "verify_url": "http://johnrachwan.pythonanywhere.com",
4
+ "smash_config": {
5
+ "pruners": "None",
6
+ "pruning_ratio": 0.0,
7
+ "factorizers": "None",
8
+ "quantizers": "['llm-int8']",
9
+ "weight_quantization_bits": 4,
10
+ "output_deviation": 0.005,
11
+ "compilers": "None",
12
+ "static_batch": true,
13
+ "static_shape": true,
14
+ "controlnet": "None",
15
+ "unet_dim": 4,
16
+ "device": "cuda",
17
+ "cache_dir": "/ceph/hdd/staff/charpent/.cache/modelsw6weqh39",
18
+ "batch_size": 1,
19
+ "model_name": "ucsahin/TraVisionLM-base",
20
+ "task": "text_text_generation",
21
+ "max_batch_size": 1,
22
+ "qtype_weight": "torch.qint8",
23
+ "qtype_activation": "torch.quint8",
24
+ "qobserver": "<class 'torch.ao.quantization.observer.MinMaxObserver'>",
25
+ "qscheme": "torch.per_tensor_symmetric",
26
+ "qconfig": "x86",
27
+ "group_size": 128,
28
+ "damp_percent": 0.1,
29
+ "save_load_fn": "bitsandbytes"
30
+ }
31
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<image>"
4
+ ],
5
+ "bos_token": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "eos_token": {
13
+ "content": "<|endoftext|>",
14
+ "lstrip": false,
15
+ "normalized": true,
16
+ "rstrip": false,
17
+ "single_word": false
18
+ },
19
+ "pad_token": {
20
+ "content": "<|endoftext|>",
21
+ "lstrip": false,
22
+ "normalized": true,
23
+ "rstrip": false,
24
+ "single_word": false
25
+ },
26
+ "unk_token": {
27
+ "content": "<|endoftext|>",
28
+ "lstrip": false,
29
+ "normalized": true,
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
The diff for this file is too large to render. See raw diff
 
vocab.json ADDED
The diff for this file is too large to render. See raw diff