hf-fetch-model 0.9.6

Download, inspect, and compare HuggingFace models from Rust. Multi-connection parallel downloads plus safetensors header inspection via HTTP Range. No weight data downloaded.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// SPDX-License-Identifier: MIT OR Apache-2.0

//! Minimal download example.
//!
//! Run: `cargo run --example basic`

#[tokio::main]
async fn main() -> Result<(), hf_fetch_model::FetchError> {
    let outcome = hf_fetch_model::download("julien-c/dummy-unknown".to_owned()).await?;

    if outcome.is_cached() {
        println!("Cached at: {}", outcome.inner().display());
    } else {
        println!("Downloaded to: {}", outcome.inner().display());
    }
    Ok(())
}