Download algorithms/common/base_algo.py from BonanDing/DeMemWM: direct link, hf CLI and curl.
- Browser
- Download file 454 Bytes
-
https://huggingface.co/BonanDing/DeMemWM/resolve/main/algorithms/common/base_algo.py
- Command line
-
hf download hf://BonanDing/DeMemWM/algorithms/common/base_algo.py
-
curl -L -o base_algo.py https://huggingface.co/BonanDing/DeMemWM/resolve/main/algorithms/common/base_algo.py
454 Bytes
| from abc import ABC, abstractmethod | |
| from typing import Any, Dict, List, Optional, Tuple, Union | |
| from omegaconf import DictConfig | |
| class BaseAlgo(ABC): | |
| """ | |
| A base class for generic algorithms. | |
| """ | |
| def __init__(self, cfg: DictConfig): | |
| super().__init__() | |
| self.cfg = cfg | |
| def run(*args: Any, **kwargs: Any) -> Any: | |
| """ | |
| Run the algorithm. | |
| """ | |
| raise NotImplementedError | |