mistralrs

Trait ModelPaths

source
pub trait ModelPaths: AsAny + Debug {
Show 14 methods // Required methods fn get_weight_filenames(&self) -> &[PathBuf]; fn get_config_filename(&self) -> &PathBuf; fn get_tokenizer_filename(&self) -> &PathBuf; fn get_template_filename(&self) -> &Option<PathBuf>; fn get_adapter_filenames(&self) -> &Option<Vec<(String, PathBuf)>>; fn get_adapter_configs( &self, ) -> &Option<Vec<((String, String), LoraConfig)>>; fn get_classifier_path(&self) -> &Option<PathBuf>; fn get_classifier_config(&self) -> &Option<XLoraConfig>; fn get_ordering(&self) -> &Option<Ordering>; fn get_gen_conf_filename(&self) -> Option<&PathBuf>; fn get_lora_preload_adapter_info( &self, ) -> &Option<HashMap<String, (PathBuf, LoraConfig)>>; fn get_preprocessor_config(&self) -> &Option<PathBuf>; fn get_processor_config(&self) -> &Option<PathBuf>; fn get_chat_template_json(&self) -> &Option<PathBuf>;
}
Expand description

ModelPaths abstracts the mechanism to get all necessary files for running a model. For example LocalModelPaths implements ModelPaths when all files are in the local file system.

Required Methods§

source

fn get_weight_filenames(&self) -> &[PathBuf]

Model weights files (multiple files supported).

source

fn get_config_filename(&self) -> &PathBuf

Retrieve the PretrainedConfig file.

source

fn get_tokenizer_filename(&self) -> &PathBuf

A serialised tokenizers.Tokenizer HuggingFace object.

source

fn get_template_filename(&self) -> &Option<PathBuf>

File where the content is expected to deserialize to ChatTemplate.

source

fn get_adapter_filenames(&self) -> &Option<Vec<(String, PathBuf)>>

Optional adapter files. (String, PathBuf) is of the form (id name, path).

source

fn get_adapter_configs(&self) -> &Option<Vec<((String, String), LoraConfig)>>

Configuration of optional adapters. (String, String) is of the form (id name, name).

source

fn get_classifier_path(&self) -> &Option<PathBuf>

Filepath for the XLORA classifier

source

fn get_classifier_config(&self) -> &Option<XLoraConfig>

XLoraConfig for the XLORA classifier

source

fn get_ordering(&self) -> &Option<Ordering>

Return the defined ordering of adapters and layers within the model.

source

fn get_gen_conf_filename(&self) -> Option<&PathBuf>

Filepath for general model configuration.

source

fn get_lora_preload_adapter_info( &self, ) -> &Option<HashMap<String, (PathBuf, LoraConfig)>>

Information for preloading LoRA adapters (adapter name, the weight file, and the config).

source

fn get_preprocessor_config(&self) -> &Option<PathBuf>

Get the preprocessor config (for the vision models). This is used to pre process images.

source

fn get_processor_config(&self) -> &Option<PathBuf>

Get the processor config (for the vision models). This is primarily used for the chat template.

source

fn get_chat_template_json(&self) -> &Option<PathBuf>

Get the explicit chat template. If specified, this overwrites anything in the tokenizer_config.json

Implementors§