Buckets:

download
raw
936 Bytes
from typing import Type, Dict, Any, Optional
from promethium.ml.models.base import PromethiumModel
from promethium.core.logging import get_logger
logger = get_logger(__name__)
class ModelRegistry:
_registry: Dict[str, Type[PromethiumModel]] = {}
@classmethod
def register(cls, name: str):
def decorator(model_cls: Type[PromethiumModel]):
if name in cls._registry:
logger.warning(f"Model {name} already registered. Overwriting.")
cls._registry[name] = model_cls
return model_cls
return decorator
@classmethod
def create(cls, name: str, config: Dict[str, Any]) -> PromethiumModel:
if name not in cls._registry:
raise ValueError(f"Model {name} not found in registry. Available: {list(cls._registry.keys())}")
logger.info(f"Creating model: {name} | Config: {config}")
return cls._registry[name](config)

Xet Storage Details

Size:
936 Bytes
·
Xet hash:
479f97a65d935ca02bb0b2540cfd70bbbd78377cc295f6f7a1c56b53b567c2f5

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.