diffusion_rs_common

Function from_mmaped_safetensors

source
pub fn from_mmaped_safetensors<'a>(
    paths: Vec<FileData>,
    dtype: Option<DType>,
    device: &Device,
    silent: bool,
    src: Arc<ModelSource>,
) -> Result<VarBuilderArgs<'a, Box<dyn SimpleBackend>>>
Expand description

Load tensors into a VarBuilder backed by a VarMap using MmapedSafetensors. Set silent to not show a progress bar.

ยงPredicate semantics:

  • If regexes is specified, this will be used in make_dummy_predicate based on .any
  • Otherwise, only include keys for which predicate evaluates to true.