| Total Complexity | 7 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from abc import ABC, abstractmethod |
||
| 2 | from typing import Dict, Protocol, Tuple |
||
| 3 | from numpy.typing import NDArray |
||
| 4 | |||
| 5 | |||
| 6 | class PretrainedModelRoutinesCapable(Protocol): |
||
| 7 | def load_layers(self, file_path: str) -> NDArray: ... |
||
| 8 | |||
| 9 | def get_id(self, layer: NDArray) -> str: ... |
||
| 10 | |||
| 11 | def get_layers_dict(self, layers: NDArray) -> Dict[str, NDArray]: ... |
||
| 12 | |||
| 13 | def get_weights(self, layer: NDArray) -> Tuple[NDArray, NDArray]: ... |
||
| 14 | |||
| 15 | |||
| 16 | class ModelHandlerInterface(ABC): |
||
| 17 | |||
| 18 | @property |
||
| 19 | @abstractmethod |
||
| 20 | def environment_variable(self) -> str: |
||
| 21 | raise NotImplementedError |
||
| 22 | |||
| 23 | @property |
||
| 24 | @abstractmethod |
||
| 25 | def model_routines(self) -> PretrainedModelRoutinesCapable: |
||
| 26 | raise NotImplementedError |
||
| 27 | |||
| 28 | @property |
||
| 29 | @abstractmethod |
||
| 30 | def model_load_exception_text(self) -> str: |
||
| 31 | raise NotImplementedError |