jadechoghari HF Staff commited on
Commit
5080bea
·
verified ·
1 Parent(s): 65d8353

Migrate policy to PolicyProcessorPipeline system (#1)

Browse files

- Migrate policy to PolicyProcessorPipeline system (413c21db4730b1a293c038748b3291c966dfc1b6)

README.md ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ datasets: unknown
3
+ library_name: lerobot
4
+ license: apache-2.0
5
+ model_name: xvla
6
+ pipeline_tag: robotics
7
+ tags:
8
+ - xvla
9
+ - lerobot
10
+ - robotics
11
+ ---
12
+
13
+ # Model Card for xvla
14
+
15
+ <!-- Provide a quick summary of what the model is/does. -->
16
+
17
+
18
+ _Model type not recognized — please update this template._
19
+
20
+
21
+ This policy has been trained and pushed to the Hub using [LeRobot](https://github.com/huggingface/lerobot).
22
+ See the full documentation at [LeRobot Docs](https://huggingface.co/docs/lerobot/index).
23
+
24
+ ---
25
+
26
+ ## How to Get Started with the Model
27
+
28
+ For a complete walkthrough, see the [training guide](https://huggingface.co/docs/lerobot/il_robots#train-a-policy).
29
+ Below is the short version on how to train and run inference/eval:
30
+
31
+ ### Train from scratch
32
+
33
+ ```bash
34
+ lerobot-train \
35
+ --dataset.repo_id=${HF_USER}/<dataset> \
36
+ --policy.type=act \
37
+ --output_dir=outputs/train/<desired_policy_repo_id> \
38
+ --job_name=lerobot_training \
39
+ --policy.device=cuda \
40
+ --policy.repo_id=${HF_USER}/<desired_policy_repo_id>
41
+ --wandb.enable=true
42
+ ```
43
+
44
+ _Writes checkpoints to `outputs/train/<desired_policy_repo_id>/checkpoints/`._
45
+
46
+ ### Evaluate the policy/run inference
47
+
48
+ ```bash
49
+ lerobot-record \
50
+ --robot.type=so100_follower \
51
+ --dataset.repo_id=<hf_user>/eval_<dataset> \
52
+ --policy.path=<hf_user>/<desired_policy_repo_id> \
53
+ --episodes=10
54
+ ```
55
+
56
+ Prefix the dataset repo with **eval\_** and supply `--policy.path` pointing to a local or hub checkpoint.
57
+
58
+ ---
59
+
60
+ ## Model Details
61
+
62
+ - **License:** apache-2.0
config.json ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "type": "xvla",
3
+ "n_obs_steps": 1,
4
+ "input_features": {
5
+ "observation.images.image": {
6
+ "type": "VISUAL",
7
+ "shape": [
8
+ 3,
9
+ 256,
10
+ 256
11
+ ]
12
+ },
13
+ "observation.images.image2": {
14
+ "type": "VISUAL",
15
+ "shape": [
16
+ 3,
17
+ 256,
18
+ 256
19
+ ]
20
+ },
21
+ "observation.state": {
22
+ "type": "STATE",
23
+ "shape": [
24
+ 8
25
+ ]
26
+ },
27
+ "observation.images.empty_camera_0": {
28
+ "type": "VISUAL",
29
+ "shape": [
30
+ 3,
31
+ 224,
32
+ 224
33
+ ]
34
+ }
35
+ },
36
+ "output_features": {
37
+ "action": {
38
+ "type": "ACTION",
39
+ "shape": [
40
+ 20
41
+ ]
42
+ }
43
+ },
44
+ "device": "cuda",
45
+ "use_amp": false,
46
+ "push_to_hub": true,
47
+ "repo_id": null,
48
+ "private": null,
49
+ "tags": null,
50
+ "license": null,
51
+ "pretrained_path": null,
52
+ "chunk_size": 30,
53
+ "n_action_steps": 30,
54
+ "normalization_mapping": {
55
+ "STATE": "IDENTITY",
56
+ "ACTION": "IDENTITY",
57
+ "VISUAL": "MEAN_STD"
58
+ },
59
+ "florence_config": {
60
+ "model_type": "florence2",
61
+ "bos_token_id": 0,
62
+ "eos_token_id": 2,
63
+ "ignore_index": -100,
64
+ "pad_token_id": 1,
65
+ "projection_dim": 1024,
66
+ "text_config": {
67
+ "vocab_size": 51289,
68
+ "activation_dropout": 0.1,
69
+ "activation_function": "gelu",
70
+ "add_bias_logits": false,
71
+ "add_final_layer_norm": false,
72
+ "attention_dropout": 0.1,
73
+ "bos_token_id": 0,
74
+ "classif_dropout": 0.1,
75
+ "classifier_dropout": 0.0,
76
+ "d_model": 1024,
77
+ "decoder_attention_heads": 16,
78
+ "decoder_ffn_dim": 4096,
79
+ "decoder_layerdrop": 0.0,
80
+ "decoder_layers": 12,
81
+ "decoder_start_token_id": 2,
82
+ "dropout": 0.1,
83
+ "early_stopping": true,
84
+ "encoder_attention_heads": 16,
85
+ "encoder_ffn_dim": 4096,
86
+ "encoder_layerdrop": 0.0,
87
+ "encoder_layers": 12,
88
+ "eos_token_id": 2,
89
+ "forced_eos_token_id": 2,
90
+ "forced_bos_token_id": 0,
91
+ "gradient_checkpointing": false,
92
+ "init_std": 0.02,
93
+ "is_encoder_decoder": true,
94
+ "label2id": {
95
+ "LABEL_0": 0,
96
+ "LABEL_1": 1,
97
+ "LABEL_2": 2
98
+ },
99
+ "max_position_embeddings": 4096,
100
+ "no_repeat_ngram_size": 3,
101
+ "normalize_before": false,
102
+ "num_hidden_layers": 12,
103
+ "pad_token_id": 1,
104
+ "scale_embedding": false,
105
+ "num_beams": 3
106
+ },
107
+ "vision_config": {
108
+ "model_type": "davit",
109
+ "drop_path_rate": 0.1,
110
+ "patch_size": [
111
+ 7,
112
+ 3,
113
+ 3,
114
+ 3
115
+ ],
116
+ "patch_stride": [
117
+ 4,
118
+ 2,
119
+ 2,
120
+ 2
121
+ ],
122
+ "patch_padding": [
123
+ 3,
124
+ 1,
125
+ 1,
126
+ 1
127
+ ],
128
+ "patch_prenorm": [
129
+ false,
130
+ true,
131
+ true,
132
+ true
133
+ ],
134
+ "enable_checkpoint": false,
135
+ "dim_embed": [
136
+ 256,
137
+ 512,
138
+ 1024,
139
+ 2048
140
+ ],
141
+ "num_heads": [
142
+ 8,
143
+ 16,
144
+ 32,
145
+ 64
146
+ ],
147
+ "num_groups": [
148
+ 8,
149
+ 16,
150
+ 32,
151
+ 64
152
+ ],
153
+ "depths": [
154
+ 1,
155
+ 1,
156
+ 9,
157
+ 1
158
+ ],
159
+ "window_size": 12,
160
+ "projection_dim": 1024,
161
+ "visual_temporal_embedding": {
162
+ "type": "COSINE",
163
+ "max_temporal_embeddings": 100
164
+ },
165
+ "image_pos_embed": {
166
+ "type": "learned_abs_2d",
167
+ "max_pos_embeddings": 50
168
+ },
169
+ "image_feature_source": [
170
+ "spatial_avg_pool",
171
+ "temporal_avg_pool"
172
+ ]
173
+ },
174
+ "vocab_size": 51289,
175
+ "torch_dtype": "float32",
176
+ "is_encoder_decoder": true
177
+ },
178
+ "tokenizer_name": "facebook/bart-large",
179
+ "tokenizer_max_length": 1024,
180
+ "tokenizer_padding_side": "right",
181
+ "pad_language_to": "max_length",
182
+ "hidden_size": 1024,
183
+ "depth": 24,
184
+ "num_heads": 16,
185
+ "mlp_ratio": 4.0,
186
+ "num_domains": 30,
187
+ "len_soft_prompts": 32,
188
+ "dim_time": 32,
189
+ "max_len_seq": 512,
190
+ "use_hetero_proj": false,
191
+ "action_mode": "ee6d",
192
+ "num_denoising_steps": 10,
193
+ "use_proprio": true,
194
+ "max_state_dim": 20,
195
+ "domain_feature_key": null,
196
+ "resize_imgs_with_padding": [
197
+ 224,
198
+ 224
199
+ ],
200
+ "num_image_views": 3,
201
+ "empty_cameras": 1,
202
+ "optimizer_lr": 0.0001,
203
+ "optimizer_betas": [
204
+ 0.9,
205
+ 0.95
206
+ ],
207
+ "optimizer_eps": 1e-08,
208
+ "optimizer_weight_decay": 0.0001,
209
+ "optimizer_grad_clip_norm": 10.0,
210
+ "scheduler_warmup_steps": 1000,
211
+ "scheduler_decay_steps": 30000,
212
+ "scheduler_decay_lr": 2.5e-06
213
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f05bc0fab1c9523d7f5d6b41a651313641ca2227a88822249845da8e20e036c9
3
+ size 3519073692
policy_postprocessor.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "policy_postprocessor",
3
+ "steps": [
4
+ {
5
+ "registry_name": "unnormalizer_processor",
6
+ "config": {
7
+ "eps": 1e-08,
8
+ "features": {
9
+ "action": {
10
+ "type": "ACTION",
11
+ "shape": [
12
+ 20
13
+ ]
14
+ }
15
+ },
16
+ "norm_map": {
17
+ "STATE": "IDENTITY",
18
+ "ACTION": "IDENTITY",
19
+ "VISUAL": "MEAN_STD"
20
+ }
21
+ }
22
+ },
23
+ {
24
+ "registry_name": "device_processor",
25
+ "config": {
26
+ "device": "cpu",
27
+ "float_dtype": null
28
+ }
29
+ }
30
+ ]
31
+ }
policy_preprocessor.json ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "policy_preprocessor",
3
+ "steps": [
4
+ {
5
+ "registry_name": "rename_observations_processor",
6
+ "config": {
7
+ "rename_map": {}
8
+ }
9
+ },
10
+ {
11
+ "registry_name": "to_batch_processor",
12
+ "config": {}
13
+ },
14
+ {
15
+ "registry_name": "tokenizer_processor",
16
+ "config": {
17
+ "max_length": 1024,
18
+ "task_key": "task",
19
+ "padding_side": "right",
20
+ "padding": "max_length",
21
+ "truncation": true,
22
+ "tokenizer_name": "facebook/bart-large"
23
+ }
24
+ },
25
+ {
26
+ "registry_name": "device_processor",
27
+ "config": {
28
+ "device": "cuda",
29
+ "float_dtype": null
30
+ }
31
+ },
32
+ {
33
+ "registry_name": "normalizer_processor",
34
+ "config": {
35
+ "eps": 1e-08,
36
+ "features": {
37
+ "observation.images.image": {
38
+ "type": "VISUAL",
39
+ "shape": [
40
+ 3,
41
+ 256,
42
+ 256
43
+ ]
44
+ },
45
+ "observation.images.image2": {
46
+ "type": "VISUAL",
47
+ "shape": [
48
+ 3,
49
+ 256,
50
+ 256
51
+ ]
52
+ },
53
+ "observation.state": {
54
+ "type": "STATE",
55
+ "shape": [
56
+ 8
57
+ ]
58
+ },
59
+ "observation.images.empty_camera_0": {
60
+ "type": "VISUAL",
61
+ "shape": [
62
+ 3,
63
+ 224,
64
+ 224
65
+ ]
66
+ },
67
+ "action": {
68
+ "type": "ACTION",
69
+ "shape": [
70
+ 20
71
+ ]
72
+ }
73
+ },
74
+ "norm_map": {
75
+ "STATE": "IDENTITY",
76
+ "ACTION": "IDENTITY",
77
+ "VISUAL": "MEAN_STD"
78
+ }
79
+ }
80
+ }
81
+ ]
82
+ }