hf-mem 0.0.5

CLI to estimate inference memory requirements from the Hugging Face Hub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use serde::Deserialize;
use std::collections::HashMap;

#[derive(Deserialize, Debug)]
pub struct FileType {
    pub dtype: Option<String>,
    pub shape: Option<Vec<u64>>,
    #[allow(unused)]
    data_offsets: Option<(u64, u64)>,
}

#[derive(Deserialize, Debug)]
pub struct ModelIndex {
    pub weight_map: HashMap<String, String>,
}