pub fn create_model(
    model: Models,
    cache_dir: &Option<PathBuf>
) -> Result<(Model, Device), Box<dyn Error>>
Expand description

Creates and loads model weights from the Hugging Face Hub.

Arguments

  • model - The model enum specifying the model to load.
  • cache_dir - Optional directory for caching downloaded models.

Returns

Returns a result containing a tuple of ModelWeights and Device, or an error if loading fails.