mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-23 12:40:08 +00:00
style: revert quadruple backticks to triple (prettier compat)
Made-with: Cursor
This commit is contained in:
@@ -88,7 +88,7 @@ policy_preprocessor = NormalizerProcessorStep(stats=dataset_stats)
|
|||||||
|
|
||||||
The same policy can work with different environment processors, and the same environment processor can work with different policies:
|
The same policy can work with different environment processors, and the same environment processor can work with different policies:
|
||||||
|
|
||||||
````python
|
```python
|
||||||
# Use SmolVLA policy with LIBERO environment
|
# Use SmolVLA policy with LIBERO environment
|
||||||
libero_preprocessor, libero_postprocessor = make_env_pre_post_processors(libero_cfg)
|
libero_preprocessor, libero_postprocessor = make_env_pre_post_processors(libero_cfg)
|
||||||
smolvla_preprocessor, smolvla_postprocessor = make_pre_post_processors(smolvla_cfg)
|
smolvla_preprocessor, smolvla_postprocessor = make_pre_post_processors(smolvla_cfg)
|
||||||
@@ -96,7 +96,7 @@ smolvla_preprocessor, smolvla_postprocessor = make_pre_post_processors(smolvla_c
|
|||||||
# Or use ACT policy with the same LIBERO environment
|
# Or use ACT policy with the same LIBERO environment
|
||||||
libero_preprocessor, libero_postprocessor = make_env_pre_post_processors(libero_cfg)
|
libero_preprocessor, libero_postprocessor = make_env_pre_post_processors(libero_cfg)
|
||||||
act_preprocessor, act_postprocessor = make_pre_post_processors(act_cfg)
|
act_preprocessor, act_postprocessor = make_pre_post_processors(act_cfg)
|
||||||
````
|
```
|
||||||
|
|
||||||
### 3. **Easier Experimentation**
|
### 3. **Easier Experimentation**
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ class LiberoVelocityProcessorStep(ObservationProcessorStep):
|
|||||||
state = torch.cat([eef_pos, eef_axisangle, eef_vel,
|
state = torch.cat([eef_pos, eef_axisangle, eef_vel,
|
||||||
gripper_pos, gripper_vel], dim=-1) # 14D
|
gripper_pos, gripper_vel], dim=-1) # 14D
|
||||||
return state
|
return state
|
||||||
````
|
```
|
||||||
|
|
||||||
### 4. **Cleaner Environment Code**
|
### 4. **Cleaner Environment Code**
|
||||||
|
|
||||||
@@ -312,7 +312,7 @@ class MyEnvProcessorStep(ObservationProcessorStep):
|
|||||||
|
|
||||||
### 2. Update the Factory
|
### 2. Update the Factory
|
||||||
|
|
||||||
````python
|
```python
|
||||||
# In src/lerobot/envs/configs.py
|
# In src/lerobot/envs/configs.py
|
||||||
@EnvConfig.register_subclass("myenv")
|
@EnvConfig.register_subclass("myenv")
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -326,7 +326,7 @@ class MyEnvConfig(EnvConfig):
|
|||||||
PolicyProcessorPipeline(steps=[MyEnvProcessorStep()]),
|
PolicyProcessorPipeline(steps=[MyEnvProcessorStep()]),
|
||||||
PolicyProcessorPipeline(steps=[]),
|
PolicyProcessorPipeline(steps=[]),
|
||||||
)
|
)
|
||||||
````
|
```
|
||||||
|
|
||||||
### 3. Use in Evaluation
|
### 3. Use in Evaluation
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ lerobot-eval \
|
|||||||
--policy.path=lerobot/my_policy \
|
--policy.path=lerobot/my_policy \
|
||||||
--env.type=myenv \ # Automatically uses MyEnvProcessorStep
|
--env.type=myenv \ # Automatically uses MyEnvProcessorStep
|
||||||
--eval.n_episodes=10
|
--eval.n_episodes=10
|
||||||
````
|
```
|
||||||
|
|
||||||
## Future: Environment Postprocessors
|
## Future: Environment Postprocessors
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user