| 1 | from typing import Protocol, TypeVar |
| 2 | |
| 3 | ModelType = TypeVar("ModelType") |
| 4 | |
| 5 | |
| 6 | class ModelConfigurator(Protocol[ModelType]): |
| 7 | """Protocol for model loader classes that instantiates models from a configuration dictionary.""" |
| 8 | |
| 9 | @classmethod |
| 10 | def from_config(cls, config: dict) -> ModelType: ... |
| 11 |