Views
No views yet
huggingface-cli download --resume-download --local-dir-use-symlinks False ${model} --local-dir $(basename ${model})1export OPENPI_DATA_HOME=/PATH/TO/OPENPI_DATA_HOME
2export LEROBOT_HOME=/PATH/TO/LEROBOT_HOME
3
4uv run scripts/serve_policy.py policy:checkpoint \
5 --policy.config=pi0_fast_fractal_fft_pt_tokenizer \
6 --policy.dir=$THE_MODEL_PATH1@dataclasses.dataclass(frozen=True)
2class LeRobotFractalDataConfig(DataConfigFactory):
3 use_quantile_norm: bool = True
4
5 # Action keys that will be used to read the action sequence from the dataset.
6 action_sequence_keys: Sequence[str] = ("action",)
7
8 prompt_from_task: bool = True
9
10 @override
11 def create(self, assets_dirs: pathlib.Path, model_config: _model.BaseModelConfig) -> DataConfig:
12 # Make inputs look like they come from the Libero environment
13 repack_transform = _transforms.Group(
14 inputs=[
15 _transforms.RepackTransform(
16 {
17 "observation/primary_image": "observation.images.image",
18 "observation/state": "observation.state",
19 "actions": "action",
20 "prompt": "prompt",
21 }
22 )
23 ]
24 )
25
26 # Prepare data for policy training
27 # Convert images to uint8 numpy arrays, add masks
28 data_transforms = _transforms.Group(
29 inputs=[
30 fractal_policy.FractalInputs(
31 action_dim=model_config.action_dim,
32 model_type=model_config.model_type,
33 )
34 ],
35 outputs=[fractal_policy.FractalOutputs()],
36 )
37
38 # Model transforms include things like tokenizing the prompt and action targets
39 model_transforms = ModelTransformFactory()(model_config)
40
41 return dataclasses.replace(
42 self.create_base_config(assets_dirs),
43 repack_transforms=repack_transform,
44 data_transforms=data_transforms,
45 model_transforms=model_transforms,
46 use_quantile_norm=self.use_quantile_norm,
47 action_sequence_keys=self.action_sequence_keys,
48 prompt_from_task=self.prompt_from_task,
49 )