GvineQQ commited on
Commit
f50690d
·
verified ·
1 Parent(s): 9c16803

Upload OpenVLA grasp model checkpoint

Browse files
action_head--22000_checkpoint.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f685846e462b77f5b950aa72b6e1262b1b486ca73e3445543bfd0796c8bce598
3
+ size 604453726
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "<PAD>": 32000
3
+ }
config.json ADDED
@@ -0,0 +1,415 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "norm_stats": {
3
+ "gen72_grasp_best2": {
4
+ "action": {
5
+ "mean": [
6
+ 79.11602783203125,
7
+ 94.15535736083984,
8
+ -80.4166259765625,
9
+ -93.67428588867188,
10
+ -3.3462841510772705,
11
+ 17.82291603088379,
12
+ 6.387060165405273,
13
+ 78.9906997680664,
14
+ -82.27678680419922,
15
+ 88.60293579101562,
16
+ 82.36312103271484,
17
+ -95.4980239868164,
18
+ 3.2222084999084473,
19
+ 15.378264427185059,
20
+ 1.2210661172866821,
21
+ 80.26712799072266
22
+ ],
23
+ "std": [
24
+ 21.024213790893555,
25
+ 5.583713531494141,
26
+ 10.143651008605957,
27
+ 2.8190293312072754,
28
+ 6.1579060554504395,
29
+ 12.958017349243164,
30
+ 9.206350326538086,
31
+ 38.70134735107422,
32
+ 24.093891143798828,
33
+ 10.70143985748291,
34
+ 13.960134506225586,
35
+ 3.1140949726104736,
36
+ 12.975412368774414,
37
+ 19.39619255065918,
38
+ 11.416078567504883,
39
+ 38.01255416870117
40
+ ],
41
+ "max": [
42
+ 112.63500213623047,
43
+ 102.0,
44
+ -43.02000045776367,
45
+ -68.55000305175781,
46
+ 20.434999465942383,
47
+ 61.125,
48
+ 46.845001220703125,
49
+ 100.0,
50
+ -18.19499969482422,
51
+ 102.0,
52
+ 110.38999938964844,
53
+ -72.7699966430664,
54
+ 71.93499755859375,
55
+ 67.31999969482422,
56
+ 42.23500061035156,
57
+ 100.0
58
+ ],
59
+ "min": [
60
+ 31.375,
61
+ 66.01000213623047,
62
+ -99.53500366210938,
63
+ -95.75499725341797,
64
+ -38.540000915527344,
65
+ -22.940000534057617,
66
+ -37.529998779296875,
67
+ 0.0,
68
+ -115.30999755859375,
69
+ 14.984999656677246,
70
+ 18.020000457763672,
71
+ -97.47000122070312,
72
+ -22.719999313354492,
73
+ -23.639999389648438,
74
+ -41.84000015258789,
75
+ 0.0
76
+ ],
77
+ "q01": [
78
+ 34.29199905395508,
79
+ 78.30999755859375,
80
+ -93.43000030517578,
81
+ -95.44999694824219,
82
+ -20.040000915527344,
83
+ -3.5509999990463235,
84
+ -15.819999694824219,
85
+ 0.0,
86
+ -109.94999694824219,
87
+ 46.845001220703125,
88
+ 35.15999984741211,
89
+ -97.29000091552734,
90
+ -15.1479998588562,
91
+ -12.739999771118164,
92
+ -30.791500282287597,
93
+ 0.0
94
+ ],
95
+ "q99": [
96
+ 105.26450119018561,
97
+ 102.0,
98
+ -49.8484996795654,
99
+ -80.68149948120117,
100
+ 8.350000381469727,
101
+ 47.290000915527344,
102
+ 32.16999816894531,
103
+ 100.0,
104
+ -30.818500328063934,
105
+ 102.0,
106
+ 100.80999755859375,
107
+ -81.88200302124021,
108
+ 52.8650016784668,
109
+ 55.61800079345706,
110
+ 30.233500289916996,
111
+ 100.0
112
+ ],
113
+ "mask": [
114
+ true,
115
+ true,
116
+ true,
117
+ true,
118
+ true,
119
+ true,
120
+ true,
121
+ true,
122
+ true,
123
+ true,
124
+ true,
125
+ true,
126
+ true,
127
+ true,
128
+ true,
129
+ true
130
+ ]
131
+ },
132
+ "proprio": {
133
+ "mean": [
134
+ 79.11497497558594,
135
+ 94.18975830078125,
136
+ -80.38821411132812,
137
+ -93.6719970703125,
138
+ -3.3557398319244385,
139
+ 17.77706527709961,
140
+ 6.375845909118652,
141
+ 78.99101257324219,
142
+ -82.22480773925781,
143
+ 88.610107421875,
144
+ 82.32734680175781,
145
+ -95.49593353271484,
146
+ 3.2511658668518066,
147
+ 15.379179000854492,
148
+ 1.202197551727295,
149
+ 80.26780700683594
150
+ ],
151
+ "std": [
152
+ 20.358299255371094,
153
+ 5.266684055328369,
154
+ 9.759184837341309,
155
+ 2.6425156593322754,
156
+ 5.872856140136719,
157
+ 12.372116088867188,
158
+ 8.679393768310547,
159
+ 38.70150375366211,
160
+ 23.474021911621094,
161
+ 10.264312744140625,
162
+ 13.466100692749023,
163
+ 2.960315227508545,
164
+ 12.600417137145996,
165
+ 18.766708374023438,
166
+ 11.020885467529297,
167
+ 38.01284408569336
168
+ ],
169
+ "max": [
170
+ 108.94000244140625,
171
+ 102.0199966430664,
172
+ -45.0099983215332,
173
+ -72.97000122070312,
174
+ 14.890000343322754,
175
+ 55.84000015258789,
176
+ 46.47999954223633,
177
+ 100.0,
178
+ -21.459999084472656,
179
+ 102.01000213623047,
180
+ 104.38999938964844,
181
+ -73.69999694824219,
182
+ 62.630001068115234,
183
+ 64.4000015258789,
184
+ 40.790000915527344,
185
+ 100.0
186
+ ],
187
+ "min": [
188
+ 32.54999923706055,
189
+ 73.81999969482422,
190
+ -98.31999969482422,
191
+ -95.58000183105469,
192
+ -36.43000030517578,
193
+ -16.389999389648438,
194
+ -26.139999389648438,
195
+ 0.0,
196
+ -111.0999984741211,
197
+ 28.559999465942383,
198
+ 19.8700008392334,
199
+ -97.37000274658203,
200
+ -16.200000762939453,
201
+ -18.959999084472656,
202
+ -39.83000183105469,
203
+ 0.0
204
+ ],
205
+ "q01": [
206
+ 36.040000915527344,
207
+ 79.12000274658203,
208
+ -92.80000305175781,
209
+ -95.37999725341797,
210
+ -19.156999778747558,
211
+ -0.11400000452995164,
212
+ -12.917000007629394,
213
+ 0.0,
214
+ -109.78100128173828,
215
+ 49.36499938964844,
216
+ 36.233000946044925,
217
+ -97.2300033569336,
218
+ -14.706999969482421,
219
+ -12.258000183105468,
220
+ -30.653999710083006,
221
+ 0.0
222
+ ],
223
+ "q99": [
224
+ 102.68300018310553,
225
+ 102.01000213623047,
226
+ -51.226001358032214,
227
+ -81.30999755859375,
228
+ 8.239999771118164,
229
+ 45.500998687744165,
230
+ 31.277000617980963,
231
+ 100.0,
232
+ -31.829999351501392,
233
+ 101.95999908447266,
234
+ 100.08000183105469,
235
+ -82.35599975585936,
236
+ 51.74799919128421,
237
+ 53.9569995880127,
238
+ 29.15399971008302,
239
+ 100.0
240
+ ]
241
+ },
242
+ "num_transitions": 16131,
243
+ "num_trajectories": 49
244
+ }
245
+ },
246
+ "n_action_bins": 256,
247
+ "vision_backbone_id": "dinosiglip-vit-so-224px",
248
+ "llm_backbone_id": "llama2-7b-pure",
249
+ "arch_specifier": "no-align+fused-gelu-mlp",
250
+ "output_projector_states": false,
251
+ "use_fused_vision_backbone": true,
252
+ "timm_model_ids": [
253
+ "vit_large_patch14_reg4_dinov2.lvd142m",
254
+ "vit_so400m_patch14_siglip_224"
255
+ ],
256
+ "timm_override_act_layers": [
257
+ null,
258
+ null
259
+ ],
260
+ "image_sizes": [
261
+ 224,
262
+ 224
263
+ ],
264
+ "image_resize_strategy": "resize-naive",
265
+ "hf_llm_id": "meta-llama/Llama-2-7b-hf",
266
+ "llm_max_length": 2048,
267
+ "pad_token_id": 32000,
268
+ "pad_to_multiple_of": 64,
269
+ "text_config": {
270
+ "vocab_size": 32064,
271
+ "max_position_embeddings": 2048,
272
+ "hidden_size": 4096,
273
+ "intermediate_size": 11008,
274
+ "num_hidden_layers": 32,
275
+ "num_attention_heads": 32,
276
+ "num_key_value_heads": 32,
277
+ "hidden_act": "silu",
278
+ "initializer_range": 0.02,
279
+ "rms_norm_eps": 1e-06,
280
+ "pretraining_tp": 1,
281
+ "use_cache": true,
282
+ "rope_theta": 10000.0,
283
+ "rope_scaling": null,
284
+ "attention_bias": false,
285
+ "attention_dropout": 0.0,
286
+ "return_dict": true,
287
+ "output_hidden_states": false,
288
+ "output_attentions": false,
289
+ "torchscript": false,
290
+ "torch_dtype": "bfloat16",
291
+ "use_bfloat16": false,
292
+ "tf_legacy_loss": false,
293
+ "pruned_heads": {},
294
+ "tie_word_embeddings": false,
295
+ "chunk_size_feed_forward": 0,
296
+ "is_encoder_decoder": false,
297
+ "is_decoder": false,
298
+ "cross_attention_hidden_size": null,
299
+ "add_cross_attention": false,
300
+ "tie_encoder_decoder": false,
301
+ "max_length": 20,
302
+ "min_length": 0,
303
+ "do_sample": false,
304
+ "early_stopping": false,
305
+ "num_beams": 1,
306
+ "num_beam_groups": 1,
307
+ "diversity_penalty": 0.0,
308
+ "temperature": 1.0,
309
+ "top_k": 50,
310
+ "top_p": 1.0,
311
+ "typical_p": 1.0,
312
+ "repetition_penalty": 1.0,
313
+ "length_penalty": 1.0,
314
+ "no_repeat_ngram_size": 0,
315
+ "encoder_no_repeat_ngram_size": 0,
316
+ "bad_words_ids": null,
317
+ "num_return_sequences": 1,
318
+ "output_scores": false,
319
+ "return_dict_in_generate": false,
320
+ "forced_bos_token_id": null,
321
+ "forced_eos_token_id": null,
322
+ "remove_invalid_values": false,
323
+ "exponential_decay_length_penalty": null,
324
+ "suppress_tokens": null,
325
+ "begin_suppress_tokens": null,
326
+ "architectures": null,
327
+ "finetuning_task": null,
328
+ "id2label": {
329
+ "0": "LABEL_0",
330
+ "1": "LABEL_1"
331
+ },
332
+ "label2id": {
333
+ "LABEL_0": 0,
334
+ "LABEL_1": 1
335
+ },
336
+ "tokenizer_class": null,
337
+ "prefix": null,
338
+ "bos_token_id": 1,
339
+ "pad_token_id": 32000,
340
+ "eos_token_id": 2,
341
+ "sep_token_id": null,
342
+ "decoder_start_token_id": null,
343
+ "task_specific_params": null,
344
+ "problem_type": null,
345
+ "_name_or_path": "",
346
+ "model_type": "llama"
347
+ },
348
+ "return_dict": true,
349
+ "output_hidden_states": false,
350
+ "output_attentions": false,
351
+ "torchscript": false,
352
+ "torch_dtype": "bfloat16",
353
+ "use_bfloat16": false,
354
+ "tf_legacy_loss": false,
355
+ "pruned_heads": {},
356
+ "tie_word_embeddings": true,
357
+ "chunk_size_feed_forward": 0,
358
+ "is_encoder_decoder": false,
359
+ "is_decoder": false,
360
+ "cross_attention_hidden_size": null,
361
+ "add_cross_attention": false,
362
+ "tie_encoder_decoder": false,
363
+ "max_length": 20,
364
+ "min_length": 0,
365
+ "do_sample": false,
366
+ "early_stopping": false,
367
+ "num_beams": 1,
368
+ "num_beam_groups": 1,
369
+ "diversity_penalty": 0.0,
370
+ "temperature": 1.0,
371
+ "top_k": 50,
372
+ "top_p": 1.0,
373
+ "typical_p": 1.0,
374
+ "repetition_penalty": 1.0,
375
+ "length_penalty": 1.0,
376
+ "no_repeat_ngram_size": 0,
377
+ "encoder_no_repeat_ngram_size": 0,
378
+ "bad_words_ids": null,
379
+ "num_return_sequences": 1,
380
+ "output_scores": false,
381
+ "return_dict_in_generate": false,
382
+ "forced_bos_token_id": null,
383
+ "forced_eos_token_id": null,
384
+ "remove_invalid_values": false,
385
+ "exponential_decay_length_penalty": null,
386
+ "suppress_tokens": null,
387
+ "begin_suppress_tokens": null,
388
+ "architectures": [
389
+ "OpenVLAForActionPrediction"
390
+ ],
391
+ "finetuning_task": null,
392
+ "id2label": {
393
+ "0": "LABEL_0",
394
+ "1": "LABEL_1"
395
+ },
396
+ "label2id": {
397
+ "LABEL_0": 0,
398
+ "LABEL_1": 1
399
+ },
400
+ "tokenizer_class": null,
401
+ "prefix": null,
402
+ "bos_token_id": null,
403
+ "eos_token_id": null,
404
+ "sep_token_id": null,
405
+ "decoder_start_token_id": null,
406
+ "task_specific_params": null,
407
+ "problem_type": null,
408
+ "_name_or_path": "/home/guangyu/.cache/huggingface/hub/models--openvla--openvla-7b/snapshots/31f090d05236101ebfc381b61c674dd4746d4ce0",
409
+ "transformers_version": "4.40.1",
410
+ "auto_map": {
411
+ "AutoConfig": "configuration_prismatic.OpenVLAConfig",
412
+ "AutoModelForVision2Seq": "modeling_prismatic.OpenVLAForActionPrediction"
413
+ },
414
+ "model_type": "openvla"
415
+ }
dataset_statistics.json ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "gen72_grasp_best2": {
3
+ "action": {
4
+ "mean": [
5
+ 79.11602783203125,
6
+ 94.15535736083984,
7
+ -80.4166259765625,
8
+ -93.67428588867188,
9
+ -3.3462841510772705,
10
+ 17.82291603088379,
11
+ 6.387060165405273,
12
+ 78.9906997680664,
13
+ -82.27678680419922,
14
+ 88.60293579101562,
15
+ 82.36312103271484,
16
+ -95.4980239868164,
17
+ 3.2222084999084473,
18
+ 15.378264427185059,
19
+ 1.2210661172866821,
20
+ 80.26712799072266
21
+ ],
22
+ "std": [
23
+ 21.024213790893555,
24
+ 5.583713531494141,
25
+ 10.143651008605957,
26
+ 2.8190293312072754,
27
+ 6.1579060554504395,
28
+ 12.958017349243164,
29
+ 9.206350326538086,
30
+ 38.70134735107422,
31
+ 24.093891143798828,
32
+ 10.70143985748291,
33
+ 13.960134506225586,
34
+ 3.1140949726104736,
35
+ 12.975412368774414,
36
+ 19.39619255065918,
37
+ 11.416078567504883,
38
+ 38.01255416870117
39
+ ],
40
+ "max": [
41
+ 112.63500213623047,
42
+ 102.0,
43
+ -43.02000045776367,
44
+ -68.55000305175781,
45
+ 20.434999465942383,
46
+ 61.125,
47
+ 46.845001220703125,
48
+ 100.0,
49
+ -18.19499969482422,
50
+ 102.0,
51
+ 110.38999938964844,
52
+ -72.7699966430664,
53
+ 71.93499755859375,
54
+ 67.31999969482422,
55
+ 42.23500061035156,
56
+ 100.0
57
+ ],
58
+ "min": [
59
+ 31.375,
60
+ 66.01000213623047,
61
+ -99.53500366210938,
62
+ -95.75499725341797,
63
+ -38.540000915527344,
64
+ -22.940000534057617,
65
+ -37.529998779296875,
66
+ 0.0,
67
+ -115.30999755859375,
68
+ 14.984999656677246,
69
+ 18.020000457763672,
70
+ -97.47000122070312,
71
+ -22.719999313354492,
72
+ -23.639999389648438,
73
+ -41.84000015258789,
74
+ 0.0
75
+ ],
76
+ "q01": [
77
+ 34.29199905395508,
78
+ 78.30999755859375,
79
+ -93.43000030517578,
80
+ -95.44999694824219,
81
+ -20.040000915527344,
82
+ -3.5509999990463235,
83
+ -15.819999694824219,
84
+ 0.0,
85
+ -109.94999694824219,
86
+ 46.845001220703125,
87
+ 35.15999984741211,
88
+ -97.29000091552734,
89
+ -15.1479998588562,
90
+ -12.739999771118164,
91
+ -30.791500282287597,
92
+ 0.0
93
+ ],
94
+ "q99": [
95
+ 105.26450119018561,
96
+ 102.0,
97
+ -49.8484996795654,
98
+ -80.68149948120117,
99
+ 8.350000381469727,
100
+ 47.290000915527344,
101
+ 32.16999816894531,
102
+ 100.0,
103
+ -30.818500328063934,
104
+ 102.0,
105
+ 100.80999755859375,
106
+ -81.88200302124021,
107
+ 52.8650016784668,
108
+ 55.61800079345706,
109
+ 30.233500289916996,
110
+ 100.0
111
+ ],
112
+ "mask": [
113
+ true,
114
+ true,
115
+ true,
116
+ true,
117
+ true,
118
+ true,
119
+ true,
120
+ true,
121
+ true,
122
+ true,
123
+ true,
124
+ true,
125
+ true,
126
+ true,
127
+ true,
128
+ true
129
+ ]
130
+ },
131
+ "proprio": {
132
+ "mean": [
133
+ 79.11497497558594,
134
+ 94.18975830078125,
135
+ -80.38821411132812,
136
+ -93.6719970703125,
137
+ -3.3557398319244385,
138
+ 17.77706527709961,
139
+ 6.375845909118652,
140
+ 78.99101257324219,
141
+ -82.22480773925781,
142
+ 88.610107421875,
143
+ 82.32734680175781,
144
+ -95.49593353271484,
145
+ 3.2511658668518066,
146
+ 15.379179000854492,
147
+ 1.202197551727295,
148
+ 80.26780700683594
149
+ ],
150
+ "std": [
151
+ 20.358299255371094,
152
+ 5.266684055328369,
153
+ 9.759184837341309,
154
+ 2.6425156593322754,
155
+ 5.872856140136719,
156
+ 12.372116088867188,
157
+ 8.679393768310547,
158
+ 38.70150375366211,
159
+ 23.474021911621094,
160
+ 10.264312744140625,
161
+ 13.466100692749023,
162
+ 2.960315227508545,
163
+ 12.600417137145996,
164
+ 18.766708374023438,
165
+ 11.020885467529297,
166
+ 38.01284408569336
167
+ ],
168
+ "max": [
169
+ 108.94000244140625,
170
+ 102.0199966430664,
171
+ -45.0099983215332,
172
+ -72.97000122070312,
173
+ 14.890000343322754,
174
+ 55.84000015258789,
175
+ 46.47999954223633,
176
+ 100.0,
177
+ -21.459999084472656,
178
+ 102.01000213623047,
179
+ 104.38999938964844,
180
+ -73.69999694824219,
181
+ 62.630001068115234,
182
+ 64.4000015258789,
183
+ 40.790000915527344,
184
+ 100.0
185
+ ],
186
+ "min": [
187
+ 32.54999923706055,
188
+ 73.81999969482422,
189
+ -98.31999969482422,
190
+ -95.58000183105469,
191
+ -36.43000030517578,
192
+ -16.389999389648438,
193
+ -26.139999389648438,
194
+ 0.0,
195
+ -111.0999984741211,
196
+ 28.559999465942383,
197
+ 19.8700008392334,
198
+ -97.37000274658203,
199
+ -16.200000762939453,
200
+ -18.959999084472656,
201
+ -39.83000183105469,
202
+ 0.0
203
+ ],
204
+ "q01": [
205
+ 36.040000915527344,
206
+ 79.12000274658203,
207
+ -92.80000305175781,
208
+ -95.37999725341797,
209
+ -19.156999778747558,
210
+ -0.11400000452995164,
211
+ -12.917000007629394,
212
+ 0.0,
213
+ -109.78100128173828,
214
+ 49.36499938964844,
215
+ 36.233000946044925,
216
+ -97.2300033569336,
217
+ -14.706999969482421,
218
+ -12.258000183105468,
219
+ -30.653999710083006,
220
+ 0.0
221
+ ],
222
+ "q99": [
223
+ 102.68300018310553,
224
+ 102.01000213623047,
225
+ -51.226001358032214,
226
+ -81.30999755859375,
227
+ 8.239999771118164,
228
+ 45.500998687744165,
229
+ 31.277000617980963,
230
+ 100.0,
231
+ -31.829999351501392,
232
+ 101.95999908447266,
233
+ 100.08000183105469,
234
+ -82.35599975585936,
235
+ 51.74799919128421,
236
+ 53.9569995880127,
237
+ 29.15399971008302,
238
+ 100.0
239
+ ]
240
+ },
241
+ "num_transitions": 16131,
242
+ "num_trajectories": 49
243
+ }
244
+ }
lora_adapter/README.md ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: /home/guangyu/.cache/huggingface/hub/models--openvla--openvla-7b/snapshots/31f090d05236101ebfc381b61c674dd4746d4ce0
3
+ library_name: peft
4
+ ---
5
+
6
+ # Model Card for Model ID
7
+
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
+
10
+
11
+
12
+ ## Model Details
13
+
14
+ ### Model Description
15
+
16
+ <!-- Provide a longer summary of what this model is. -->
17
+
18
+
19
+
20
+ - **Developed by:** [More Information Needed]
21
+ - **Funded by [optional]:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
+
28
+ ### Model Sources [optional]
29
+
30
+ <!-- Provide the basic links for the model. -->
31
+
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
+
44
+ [More Information Needed]
45
+
46
+ ### Downstream Use [optional]
47
+
48
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
+
50
+ [More Information Needed]
51
+
52
+ ### Out-of-Scope Use
53
+
54
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
+
56
+ [More Information Needed]
57
+
58
+ ## Bias, Risks, and Limitations
59
+
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
+
62
+ [More Information Needed]
63
+
64
+ ### Recommendations
65
+
66
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
+
68
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
+
70
+ ## How to Get Started with the Model
71
+
72
+ Use the code below to get started with the model.
73
+
74
+ [More Information Needed]
75
+
76
+ ## Training Details
77
+
78
+ ### Training Data
79
+
80
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
+
82
+ [More Information Needed]
83
+
84
+ ### Training Procedure
85
+
86
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
+
88
+ #### Preprocessing [optional]
89
+
90
+ [More Information Needed]
91
+
92
+
93
+ #### Training Hyperparameters
94
+
95
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
+
97
+ #### Speeds, Sizes, Times [optional]
98
+
99
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
+
101
+ [More Information Needed]
102
+
103
+ ## Evaluation
104
+
105
+ <!-- This section describes the evaluation protocols and provides the results. -->
106
+
107
+ ### Testing Data, Factors & Metrics
108
+
109
+ #### Testing Data
110
+
111
+ <!-- This should link to a Dataset Card if possible. -->
112
+
113
+ [More Information Needed]
114
+
115
+ #### Factors
116
+
117
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
+
119
+ [More Information Needed]
120
+
121
+ #### Metrics
122
+
123
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
+
125
+ [More Information Needed]
126
+
127
+ ### Results
128
+
129
+ [More Information Needed]
130
+
131
+ #### Summary
132
+
133
+
134
+
135
+ ## Model Examination [optional]
136
+
137
+ <!-- Relevant interpretability work for the model goes here -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Environmental Impact
142
+
143
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
+
145
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
+
147
+ - **Hardware Type:** [More Information Needed]
148
+ - **Hours used:** [More Information Needed]
149
+ - **Cloud Provider:** [More Information Needed]
150
+ - **Compute Region:** [More Information Needed]
151
+ - **Carbon Emitted:** [More Information Needed]
152
+
153
+ ## Technical Specifications [optional]
154
+
155
+ ### Model Architecture and Objective
156
+
157
+ [More Information Needed]
158
+
159
+ ### Compute Infrastructure
160
+
161
+ [More Information Needed]
162
+
163
+ #### Hardware
164
+
165
+ [More Information Needed]
166
+
167
+ #### Software
168
+
169
+ [More Information Needed]
170
+
171
+ ## Citation [optional]
172
+
173
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
+
175
+ **BibTeX:**
176
+
177
+ [More Information Needed]
178
+
179
+ **APA:**
180
+
181
+ [More Information Needed]
182
+
183
+ ## Glossary [optional]
184
+
185
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
+
187
+ [More Information Needed]
188
+
189
+ ## More Information [optional]
190
+
191
+ [More Information Needed]
192
+
193
+ ## Model Card Authors [optional]
194
+
195
+ [More Information Needed]
196
+
197
+ ## Model Card Contact
198
+
199
+ [More Information Needed]
200
+ ### Framework versions
201
+
202
+ - PEFT 0.11.1
lora_adapter/adapter_config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": {
4
+ "base_model_class": "OpenVLAForActionPrediction",
5
+ "parent_library": "transformers_modules.31f090d05236101ebfc381b61c674dd4746d4ce0.modeling_prismatic"
6
+ },
7
+ "base_model_name_or_path": "/home/guangyu/.cache/huggingface/hub/models--openvla--openvla-7b/snapshots/31f090d05236101ebfc381b61c674dd4746d4ce0",
8
+ "bias": "none",
9
+ "fan_in_fan_out": false,
10
+ "inference_mode": true,
11
+ "init_lora_weights": "gaussian",
12
+ "layer_replication": null,
13
+ "layers_pattern": null,
14
+ "layers_to_transform": null,
15
+ "loftq_config": {},
16
+ "lora_alpha": 16,
17
+ "lora_dropout": 0.0,
18
+ "megatron_config": null,
19
+ "megatron_core": "megatron.core",
20
+ "modules_to_save": null,
21
+ "peft_type": "LORA",
22
+ "r": 32,
23
+ "rank_pattern": {},
24
+ "revision": null,
25
+ "target_modules": [
26
+ "fc1",
27
+ "qkv",
28
+ "k_proj",
29
+ "q_proj",
30
+ "kv",
31
+ "o_proj",
32
+ "v_proj",
33
+ "q",
34
+ "proj",
35
+ "fc2",
36
+ "down_proj",
37
+ "up_proj",
38
+ "lm_head",
39
+ "gate_proj",
40
+ "fc3"
41
+ ],
42
+ "task_type": null,
43
+ "use_dora": false,
44
+ "use_rslora": false
45
+ }
lora_adapter/adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e422139a3ade0bf21f18b3c5b69ccef1cdf28efa10fe4bd17e8b1e5692b5349
3
+ size 484467800
preprocessor_config.json ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoImageProcessor": "processing_prismatic.PrismaticImageProcessor",
4
+ "AutoProcessor": "processing_prismatic.PrismaticProcessor"
5
+ },
6
+ "image_processor_type": "PrismaticImageProcessor",
7
+ "image_resize_strategy": "resize-naive",
8
+ "input_sizes": [
9
+ [
10
+ 3,
11
+ 224,
12
+ 224
13
+ ],
14
+ [
15
+ 3,
16
+ 224,
17
+ 224
18
+ ]
19
+ ],
20
+ "interpolations": [
21
+ "bicubic",
22
+ "bicubic"
23
+ ],
24
+ "means": [
25
+ [
26
+ 0.485,
27
+ 0.456,
28
+ 0.406
29
+ ],
30
+ [
31
+ 0.5,
32
+ 0.5,
33
+ 0.5
34
+ ]
35
+ ],
36
+ "processor_class": "PrismaticProcessor",
37
+ "stds": [
38
+ [
39
+ 0.229,
40
+ 0.224,
41
+ 0.225
42
+ ],
43
+ [
44
+ 0.5,
45
+ 0.5,
46
+ 0.5
47
+ ]
48
+ ],
49
+ "tvf_crop_params": [
50
+ {
51
+ "output_size": [
52
+ 224,
53
+ 224
54
+ ]
55
+ },
56
+ {
57
+ "output_size": [
58
+ 224,
59
+ 224
60
+ ]
61
+ }
62
+ ],
63
+ "tvf_do_letterbox": false,
64
+ "tvf_letterbox_fill": null,
65
+ "tvf_normalize_params": [
66
+ {
67
+ "inplace": false,
68
+ "mean": [
69
+ 0.484375,
70
+ 0.455078125,
71
+ 0.40625
72
+ ],
73
+ "std": [
74
+ 0.228515625,
75
+ 0.2236328125,
76
+ 0.224609375
77
+ ]
78
+ },
79
+ {
80
+ "inplace": false,
81
+ "mean": [
82
+ 0.5,
83
+ 0.5,
84
+ 0.5
85
+ ],
86
+ "std": [
87
+ 0.5,
88
+ 0.5,
89
+ 0.5
90
+ ]
91
+ }
92
+ ],
93
+ "tvf_resize_params": [
94
+ {
95
+ "antialias": true,
96
+ "interpolation": 3,
97
+ "max_size": null,
98
+ "size": [
99
+ 224,
100
+ 224
101
+ ]
102
+ },
103
+ {
104
+ "antialias": true,
105
+ "interpolation": 3,
106
+ "max_size": null,
107
+ "size": [
108
+ 224,
109
+ 224
110
+ ]
111
+ }
112
+ ],
113
+ "use_fused_vision_backbone": true
114
+ }
processing_prismatic.py ADDED
@@ -0,0 +1,257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ processing_prismatic.py
3
+
4
+ HuggingFace-style preprocessor definitions for Prismatic VLMs, inheriting from `ProcessorMixin`. Default configuration
5
+ specifies `siglip-224px+7b`.
6
+ """
7
+
8
+ from typing import Any, ClassVar, List, Optional, Tuple, Union
9
+
10
+ import timm.data
11
+ import torch
12
+ import torchvision.transforms.functional as TVF
13
+ from PIL import Image
14
+ from torchvision.transforms import CenterCrop, Compose, Normalize, Resize, ToTensor
15
+ from transformers import PreTrainedTokenizerBase
16
+ from transformers.image_processing_utils import BatchFeature, ImageProcessingMixin
17
+ from transformers.processing_utils import ProcessorMixin
18
+ from transformers.tokenization_utils import PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
19
+ from transformers.utils import TensorType
20
+
21
+
22
+ # === Image Processing ===
23
+ def letterbox_pad_transform(image: Image.Image, padding_fill_value: Tuple[int, int, int]) -> Image.Image:
24
+ """Given a PIL.Image, pad to square by adding a symmetric border around the height/width."""
25
+ (w, h), max_wh = image.size, max(image.size)
26
+ horizontal_pad, vertical_pad = int((max_wh - w) / 2), int((max_wh - h) / 2)
27
+ padding = (horizontal_pad, vertical_pad, horizontal_pad, vertical_pad)
28
+
29
+ return TVF.pad(image, padding, fill=padding_fill_value, padding_mode="constant")
30
+
31
+
32
+ class PrismaticImageProcessor(ImageProcessingMixin):
33
+ model_input_names: ClassVar[List[str]] = ["pixel_values"]
34
+
35
+ def __init__(
36
+ self,
37
+ use_fused_vision_backbone: bool = False,
38
+ image_resize_strategy: str = "letterbox",
39
+ input_sizes: Optional[List[Tuple[int, int, int]]] = None,
40
+ interpolations: Optional[List[str]] = None,
41
+ means: Optional[List[Tuple[float, float, float]]] = None,
42
+ stds: Optional[List[Tuple[float, float, float]]] = None,
43
+ **kwargs: str,
44
+ ) -> None:
45
+ """
46
+ Initialize a PrismaticImageProcessor as a wrapper around a torchvision transform; this transform will be
47
+ created by TIMM, and edited to follow our custom `image_resize_strategy` logic.
48
+
49
+ @param use_fused_vision_backbone: Boolean indicating single or fused (dual) vision backbone
50
+ @param image_resize_strategy: Prismatic image resize strategy in < resize-naive | resize-crop | letterbox >
51
+ @param input_size: [TIMM :: `data_cfg`] Input image size as tuple (channels, width, height)
52
+ @param interpolation: [TIMM :: `data_cfg`] Interpolation as string (default: "bicubic")
53
+ @param mean: [TIMM :: `data_cfg`] Normalization mean as float tuple (or two-tuple if `fused_backbone`)
54
+ @param std: [TIMM :: `data_cfg`] Normalization std as float tuple (or two-tuple if `fused_backbone`)
55
+ """
56
+ self.use_fused_vision_backbone = use_fused_vision_backbone
57
+ self.image_resize_strategy = image_resize_strategy
58
+
59
+ # Handle `None` default values
60
+ input_sizes = [(3, 224, 224)] if input_sizes is None else input_sizes
61
+ means = [(0.5, 0.5, 0.5)] if means is None else means
62
+ stds = [(0.5, 0.5, 0.5)] if stds is None else stds
63
+
64
+ # TIMM `data_cfg` Parameters
65
+ self.input_sizes, self.interpolations, self.means, self.stds = input_sizes, interpolations, means, stds
66
+
67
+ # Grab torchvision transforms via TIMM =>> need to parse for specific "functional" transform values!
68
+ self.tvf_resize_params, self.tvf_crop_params, self.tvf_normalize_params = [], [], []
69
+ self.tvf_do_letterbox, self.tvf_letterbox_fill = False, None
70
+
71
+ for idx in range(len(input_sizes)):
72
+ transform = timm.data.create_transform(
73
+ input_size=self.input_sizes[idx],
74
+ interpolation=self.interpolations[idx],
75
+ mean=self.means[idx],
76
+ std=self.stds[idx],
77
+ crop_pct=1.0, # Set to 1.0 to ignore cropping (initial Resize sets `input_size`)
78
+ crop_mode="center", # Default crop mode -- no-op when `crop_pct == 1.0`
79
+ is_training=False, # No image augmentations when loading the transform!
80
+ )
81
+
82
+ # [Validation] Ensure appropriate transform structure, expected sizes
83
+ if not (
84
+ isinstance(transform, Compose)
85
+ and (len(transform.transforms) == 4)
86
+ and isinstance(transform.transforms[0], Resize)
87
+ and isinstance(transform.transforms[1], CenterCrop)
88
+ and isinstance(transform.transforms[2], ToTensor)
89
+ and isinstance(transform.transforms[3], Normalize)
90
+ and (transform.transforms[0].size == self.input_sizes[idx][-1])
91
+ and (transform.transforms[1].size == self.input_sizes[idx][-2:])
92
+ ):
93
+ raise ValueError(f"Unexpected TIMM image transformation structure/sizes: `{transform}`")
94
+
95
+ # HF Image Processors *must* be JSON-serializable; as such, cannot have torchvision. as an attribute.
96
+ # => Instead, we're going to parse the transform and call "torchvision.transforms.functional" (`tvf`)
97
+ resize_t, crop_t, norm_t = transform.transforms[0], transform.transforms[1], transform.transforms[3]
98
+ self.tvf_resize_params.append(
99
+ {
100
+ "size": resize_t.size,
101
+ "interpolation": TVF.pil_modes_mapping[resize_t.interpolation],
102
+ "max_size": None,
103
+ "antialias": True,
104
+ }
105
+ )
106
+ self.tvf_crop_params.append({"output_size": crop_t.size})
107
+ self.tvf_normalize_params.append(
108
+ {
109
+ "mean": norm_t.mean.float().numpy().tolist(),
110
+ "std": norm_t.std.float().numpy().tolist(),
111
+ "inplace": False,
112
+ }
113
+ )
114
+ self.tvf_do_letterbox, self.tvf_letterbox_fill = False, None
115
+
116
+ # Handle Prismatic `image_resize_strategy`
117
+ if self.image_resize_strategy == "resize-naive":
118
+ self.tvf_resize_params[idx]["size"] = (resize_t.size, resize_t.size)
119
+ elif self.image_resize_strategy == "letterbox":
120
+ self.tvf_do_letterbox, self.tvf_letterbox_fill = True, tuple([int(x * 255) for x in self.means[idx]])
121
+ elif self.image_resize_strategy == "resize-crop":
122
+ pass
123
+ else:
124
+ raise ValueError(f"Image resize strategy `{self.image_resize_strategy}` is not supported!")
125
+
126
+ # Dispatch **kwargs to super()
127
+ super().__init__(**kwargs)
128
+
129
+ def apply_transform(self, img: Image.Image) -> torch.Tensor:
130
+ """Apply `functional` variant of TIMM's Transform = Compose([Resize -> CenterCrop -> ToTensor -> Normalize])"""
131
+ if self.tvf_do_letterbox:
132
+ img = letterbox_pad_transform(img, self.tvf_letterbox_fill)
133
+
134
+ # [Contract] Fused Backbones expect "channel-stacked" inputs; we'll unpack on the model side!
135
+ imgs_t = []
136
+ for idx in range(len(self.input_sizes)):
137
+ img_idx = TVF.resize(img, **self.tvf_resize_params[idx])
138
+ img_idx = TVF.center_crop(img_idx, **self.tvf_crop_params[idx])
139
+ img_idx_t = TVF.to_tensor(img_idx)
140
+ img_idx_t = TVF.normalize(img_idx_t, **self.tvf_normalize_params[idx])
141
+ imgs_t.append(img_idx_t)
142
+
143
+ # [Contract] `imgs_t` is a list of Tensors of shape [3, input_size, input_size]; stack along dim = 0
144
+ img_t = torch.vstack(imgs_t)
145
+
146
+ return img_t
147
+
148
+ def preprocess(
149
+ self,
150
+ images: Union[Image.Image, List[Image.Image]],
151
+ return_tensors: Optional[Union[str, TensorType]] = None,
152
+ **_: str,
153
+ ) -> BatchFeature:
154
+ """
155
+ Preprocess an image (or batch of images); note that unlike the `transformers :: BaseImageProcessor` we
156
+ explicitly only handle PIL.Image.Image instances for simplicity.
157
+
158
+ @param images: A (batch of) PIL.Image.Image instance(s) to preprocess.
159
+ @param return_tensors: BatchFeature default Tensor format (e.g., "pt" for torch); if None, returns np.ndarray
160
+
161
+ @return: Instance of `transformers :: BatchFeature` with a single key "pixel_values"
162
+ """
163
+ if not isinstance(images, list):
164
+ images = [images]
165
+
166
+ # Apply `self.img_transform` to each image (will return list of torch.Tensors); stack into "batched" Tensor
167
+ pixel_values = torch.stack([self.apply_transform(img.convert("RGB")) for img in images])
168
+
169
+ # Return BatchFeature =>> note that for compatibility, constructor expects Dict[str, np.ndarray], so we convert
170
+ return BatchFeature(data={"pixel_values": pixel_values.float().numpy()}, tensor_type=return_tensors)
171
+
172
+ def __call__(self, images: Union[Image.Image, List[Image.Image]], **kwargs) -> BatchFeature:
173
+ return self.preprocess(images, **kwargs)
174
+
175
+
176
+ # === PrismaticProcessor =>> Wraps both ImageProcessor and Tokenizer ===
177
+ # =>> https://github.com/huggingface/transformers/blob/main/src/transformers/models/llava/processing_llava.py
178
+ class PrismaticProcessor(ProcessorMixin):
179
+ attributes: ClassVar[List[str]] = ["image_processor", "tokenizer"]
180
+ image_processor_class: str = "AutoImageProcessor"
181
+ tokenizer_class: str = "AutoTokenizer"
182
+
183
+ def __init__(
184
+ self,
185
+ image_processor: Optional[ImageProcessingMixin] = None,
186
+ tokenizer: Optional[PreTrainedTokenizerBase] = None,
187
+ ) -> None:
188
+ super().__init__(image_processor, tokenizer)
189
+
190
+ def __call__(
191
+ self,
192
+ text: Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]],
193
+ images: Union[Image.Image, List[Image.Image]],
194
+ padding: Union[bool, str, PaddingStrategy] = False,
195
+ truncation: Optional[Union[bool, str, TruncationStrategy]] = None,
196
+ max_length: Optional[int] = None,
197
+ return_tensors: Optional[Union[str, TensorType]] = TensorType.PYTORCH,
198
+ ) -> BatchFeature:
199
+ """
200
+ Preprocess a given (batch) of text/images for a Prismatic VLM; forwards text to the underlying LLM's tokenizer,
201
+ forwards images to PrismaticImageProcessor.
202
+
203
+ @param text: The (batch) of text to encode; must be a string or list of strings.
204
+ @param images: A (batch of) PIL.Image.Image instance(s) to preprocess.
205
+ @param padding: Sequence padding strategy (if multiple specified) in < True = "longest" | "max_length" | False >
206
+ @param truncation: Truncation strategy for the output sequences; requires `max_length` to be specified
207
+ @param max_length: Maximum length (in tokens) to truncate
208
+ @param return_tensors: Type of return tensors (usually "pt" or TensorType.PYTORCH)
209
+
210
+ @return: BatchFeature with keys for `input_ids`, `attention_mask` and `pixel_values`.
211
+ """
212
+ pixel_values = self.image_processor(images, return_tensors=return_tensors)["pixel_values"]
213
+ text_inputs = self.tokenizer(
214
+ text, return_tensors=return_tensors, padding=padding, truncation=truncation, max_length=max_length
215
+ )
216
+
217
+ # [Validate] Need same number of images and text inputs!
218
+ if pixel_values.shape[0] != text_inputs.input_ids.shape[0]:
219
+ raise ValueError("Batch is malformed; expected same number of images and text inputs!")
220
+
221
+ return BatchFeature(data={**text_inputs, "pixel_values": pixel_values})
222
+
223
+ # === Tokenizer Dispatch Utilities =>> check `PreTrainedTokenizerBase` for documentation ===
224
+ def batch_decode(
225
+ self,
226
+ sequences: Union[List[int], List[List[int]], torch.Tensor, Any], # `Any` = np.ndarray | tf.Tensor
227
+ skip_special_tokens: bool = False,
228
+ clean_up_tokenization_spaces: Optional[bool] = None,
229
+ **kwargs: str,
230
+ ) -> List[str]:
231
+ return self.tokenizer.batch_decode(
232
+ sequences=sequences,
233
+ skip_special_tokens=skip_special_tokens,
234
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
235
+ **kwargs,
236
+ )
237
+
238
+ def decode(
239
+ self,
240
+ token_ids: Union[int, List[int], torch.Tensor, Any], # `Any` = np.ndarray | tf.Tensor
241
+ skip_special_tokens: bool = False,
242
+ clean_up_tokenization_spaces: Optional[bool] = None,
243
+ **kwargs: str,
244
+ ) -> str:
245
+ return self.tokenizer.decode(
246
+ token_ids=token_ids,
247
+ skip_special_tokens=skip_special_tokens,
248
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
249
+ **kwargs,
250
+ )
251
+
252
+ @property
253
+ def model_input_names(self) -> List[str]:
254
+ tokenizer_input_names = self.tokenizer.model_input_names
255
+ image_processor_input_names = self.image_processor.model_input_names
256
+
257
+ return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names))
processor_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoProcessor": "processing_prismatic.PrismaticProcessor"
4
+ },
5
+ "processor_class": "PrismaticProcessor"
6
+ }
proprio_projector--22000_checkpoint.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f2e1dba8b2aaf8033ac044a441f26b36bcd241d613590016714bfba916d88bd
3
+ size 67406320
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<PAD>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": {
24
+ "content": "<unk>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
tokenizer_config.json ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "32000": {
30
+ "content": "<PAD>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ }
37
+ },
38
+ "auto_map": {
39
+ "AutoProcessor": "processing_prismatic.PrismaticProcessor"
40
+ },
41
+ "bos_token": "<s>",
42
+ "clean_up_tokenization_spaces": false,
43
+ "eos_token": "</s>",
44
+ "legacy": false,
45
+ "model_max_length": 2048,
46
+ "pad_token": "<PAD>",
47
+ "padding_side": "right",
48
+ "processor_class": "PrismaticProcessor",
49
+ "sp_model_kwargs": {},
50
+ "tokenizer_class": "LlamaTokenizer",
51
+ "unk_token": "<unk>",
52
+ "use_default_system_prompt": false
53
+ }
vision_backbone--22000_checkpoint.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e38522c6094d87902453341de9e0a227fc9cc24b5c1f1f0d6b254552f8dce20
3
+ size 3344957817