mstar.utils.hf_snapshot#
Resolving a Hugging Face repo id to a local snapshot directory.
Not model-specific: every model that reads a pipeline snapshot’s component configs needs it, so it lives here rather than in one model’s config module.
Functions
|
Local snapshot directory of a pipeline repo: a local path is used as-is, a hub id resolves through the HF cache (configs + weights of every component, offline when |
- mstar.utils.hf_snapshot.resolve_snapshot_dir(model_path_hf, cache_dir=None, allow_patterns=None)[source]#
Local snapshot directory of a pipeline repo: a local path is used as-is, a hub id resolves through the HF cache (configs + weights of every component, offline when
HF_HUB_OFFLINEis set).allow_patternslimits a download to the components the model serves, for repos that ship alternatives (a second transformer, a prompt enhancer) the deployment never loads.