Skip to main content

download_any_format

Function download_any_format 

Source
pub async fn download_any_format(
    repo_id: &str,
    format: Option<&str>,
    file_filter: Option<&str>,
    revision: &str,
    hf_token: Option<&str>,
    dest_dir: &Path,
) -> Result<DownloadedRepo>
Expand description

Download a repo’s checkpoint in whatever format it’s stored in (or a specific one, if format is given). Resolves HF’s standard sharding indices for safetensors and bin; for every other format, if more than one file matches, file_filter (a case-insensitive substring) is required to pick which ones — this avoids silently pulling every alternative quantization/variant of a multi-GB checkpoint.