Skip to main content

download_model_prefixed

Function download_model_prefixed 

Source
pub async fn download_model_prefixed(
    repo_id: &str,
    prefix: &str,
    hf_token: Option<&str>,
    model_dir: &Path,
) -> Result<ModelFiles>
Expand description

Same as download_model, but every remote path is joined under prefix first.

Pass "" for a flat repo layout (config.json, model.safetensors). Pass e.g. "classification" for a repo that keeps multiple task variants in subfolders (classification/config.json, classification/model.safetensors), as TabFM does.