emmi_data_management.checkpoint.resolver

Attributes

Functions

resolve_checkpoint(uri_or_path, *[, cache_dir, ...])

Resolve a checkpoint reference (URI or local path) to a verified local file.

Module Contents

emmi_data_management.checkpoint.resolver.PROVIDERS: list[emmi_data_management.checkpoint.types.Provider]
emmi_data_management.checkpoint.resolver.resolve_checkpoint(uri_or_path, *, cache_dir=Path.home() / '.cache' / 'emmi' / 'checkpoints', expected_sha256=None, verify_load=None, min_free_bytes=None, compute_hash=True)

Resolve a checkpoint reference (URI or local path) to a verified local file.

  • Downloads to cache if remote (atomic write).

  • Optional disk space check (estimate + min_free_bytes).

  • Optional sha256 validation.

  • Writes meta.json in the cache folder.

  • [Optional] Load smoke-test (pt|ts|onnx).

Parameters:
  • uri_or_path (str | pathlib.Path) – URI or local path.

  • cache_dir (pathlib.Path) – Cache directory.

  • expected_sha256 (str | None) – Expected checksum.

  • verify_load (str | None) – Whether to verify checkpoint loading of a specific type “pt” | “ts” | “onnx”. Defaults to None.

  • min_free_bytes (int | None) – Minimum free space. Defaults to None.

  • compute_hash (bool) – Whether to compute hash. Defaults to True.

Returns:

An instance of CheckpointMetadata.

Return type:

emmi_data_management.checkpoint.types.CheckpointMetadata