Download examples/Robocasa_tabletop/eval_files/base_config.py from mxk1998/WM4A: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/mxk1998/WM4A/resolve/main/examples/Robocasa_tabletop/eval_files/base_config.py
- Command line
-
hf download hf://mxk1998/WM4A/examples/Robocasa_tabletop/eval_files/base_config.py
-
curl -L -o base_config.py https://huggingface.co/mxk1998/WM4A/resolve/main/examples/Robocasa_tabletop/eval_files/base_config.py
1.05 kB
| from pydantic import BaseModel | |
| from abc import ABC, abstractmethod | |
| from typing import Dict, Any | |
| class ModalityConfig(BaseModel): | |
| """Configuration for a modality.""" | |
| delta_indices: list[int] | |
| """Delta indices to sample relative to the current index. The returned data will correspond to the original data at a sampled base index + delta indices.""" | |
| modality_keys: list[str] | |
| """The keys to load for the modality in the dataset.""" | |
| class BasePolicy(ABC): | |
| def get_action(self, observations: Dict[str, Any]) -> Dict[str, Any]: | |
| """ | |
| Abstract method to get the action for a given state. | |
| Args: | |
| observations: The observations from the environment. | |
| Returns: | |
| The action to take in the environment in dictionary format. | |
| """ | |
| raise NotImplementedError | |
| def get_modality_config(self) -> Dict[str, ModalityConfig]: | |
| """ | |
| Return the modality config of the policy. | |
| """ | |
| raise NotImplementedError | |