Skip to main content

cjm-substrate-hf-utils

Hugging Face Hub helpers for cjm-substrate capabilities: cache-config mixin, progress-reporting snapshot downloads, and typed-OOM model loading.

Modules

  • cjm_substrate_hf_utils.cache_config — A dataclass mixin adding HuggingFace Hub cache / revision / air-gap / security fields to a capability's config, with RELOAD_TRIGGER + JSON-schema metadata pre-set.
  • cjm_substrate_hf_utils.download — Wrap huggingface_hub.snapshot_download so per-file progress flows to the capability's report_progress, defeating the substrate's stall detector during downloads.
  • cjm_substrate_hf_utils.loading — Call model_class.from_pretrained(...) and convert CUDA OOM into the substrate's typed CapabilityResourceError for CR-7 reactive retry.

API

cjm_substrate_hf_utils.cache_config

  • HFCacheConfig class — Mixin adding HuggingFace Hub cache/revision/air-gap/security fields to a capability config.

cjm_substrate_hf_utils.download

  • snapshot_download_with_progress function — Download an HF Hub snapshot, streaming per-file progress to report_progress.

cjm_substrate_hf_utils.loading

  • load_pretrained_with_oom function — Call model_class.from_pretrained(repo_id, **kwargs), converting CUDA OOM to a typed error.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cjm_substrate_hf_utils-0.0.14.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cjm_substrate_hf_utils-0.0.14-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file cjm_substrate_hf_utils-0.0.14.tar.gz.

File metadata

  • Download URL: cjm_substrate_hf_utils-0.0.14.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for cjm_substrate_hf_utils-0.0.14.tar.gz
Algorithm Hash digest
SHA256 791af799c8710547ee92e5b95d4dc6f11931d50a2413f3da1ced355720603a4c
MD5 0ace36bb8ce9bd91ff2756c4c84a0526
BLAKE2b-256 061a2e5fb6dbc97d1c042f50998d2d5516f64c185f245c49f670548ef4d510f7

See more details on using hashes here.

File details

Details for the file cjm_substrate_hf_utils-0.0.14-py3-none-any.whl.

File metadata

File hashes

Hashes for cjm_substrate_hf_utils-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 ab63b51ebe477450015f124a8df1e354af43ab15ec68daf5ac733e825e9a1cec
MD5 d8d5a0d156a2ff16bc44ee0a0afb836d
BLAKE2b-256 4d6ab988151d95707fb93724e107daabf31b9ce1b00e6e1e1faf9d680bb1e8b4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.14 This release

2 files

0.0.13

2 files

0.0.12

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page