detrium.hub.manager

Dual-source HubManager supporting Hugging Face Hub and ModelScope with fallback and SHA256 verification.

class HubModelEntry

Metadata for an officially indexed Detrium model.

字段

名称类型默认值
namestr—
familystr—
taskstr—
recipestr—
filenamestr—
hf_repoOptional[str]None
ms_repoOptional[str]None
licensestr'Apache-2.0'
imgszint640
sha256Optional[str]None
class HubManager

Resolve and download Detrium model weights across Hugging Face Hub and ModelScope.

名称类型默认值
registry_pathPath_REGISTRY_YAML
cache_dirOptional[Path]None
providersOptional[Mapping[str, HubProvider]]None
resolve_and_download(self, model_ref: str, *, source: str='auto', revision: Optional[str]=None, timeout: float=30.0) -> Path

Return a verified local path to `model_ref` (local file, alias, `hf://`, or `ms://`).

名称类型默认值
model_refstr—
sourcestr'auto'
revisionOptional[str]None
timeoutfloat30.0
parse_hub_uri(uri: str) -> Optional[Tuple[str, str, str]]

Parse `hf://org/repo/file.pt` or `ms://org/repo/file.pt` into `(provider, repo_id, filename)`.

名称类型默认值
uristr—