Download MemGen-main/data/base_env.py from Ouzhang/low-high-reference: direct link, hf CLI and curl.
- Browser
- Download file 783 Bytes
-
https://huggingface.co/datasets/Ouzhang/low-high-reference/resolve/main/MemGen-main/data/base_env.py
- Command line
-
hf download hf://datasets/Ouzhang/low-high-reference/MemGen-main/data/base_env.py
-
curl -L -o base_env.py https://huggingface.co/datasets/Ouzhang/low-high-reference/resolve/main/MemGen-main/data/base_env.py
783 Bytes
| from abc import ABC, abstractmethod | |
| from typing import Literal, Dict, Tuple | |
| class BaseEnv(ABC): | |
| ENV_CARD: Literal["STATIC", "DYNAMIC"] = None | |
| def __init__(self, config): | |
| self.config = config | |
| def compute_reward(cls, **kwargs): | |
| ... | |
| class StaticEnv(BaseEnv): | |
| ENV_CARD = "STATIC" | |
| class DynamicEnv(BaseEnv): | |
| ENV_CARD = "DYNAMIC" | |
| def set_env(self, task_config: Dict) -> Tuple[str, str]: | |
| ... | |
| def preprocess_action(self, action: str) -> str: | |
| ... | |
| def step(self, action: str) -> Tuple[str, bool]: | |
| ... | |
| def feedback(self) -> Tuple[float, bool]: | |
| ... |