pub trait ModelPaths:
AsAny
+ Debug
+ Send
+ Sync {
// 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_gen_conf_filename(&self) -> Option<&PathBuf>;
fn get_preprocessor_config(&self) -> &Option<PathBuf>;
fn get_processor_config(&self) -> &Option<PathBuf>;
fn get_chat_template_explicit(&self) -> &Option<PathBuf>;
fn get_adapter_paths(&self) -> &AdapterPaths;
}
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§
Sourcefn get_weight_filenames(&self) -> &[PathBuf]
fn get_weight_filenames(&self) -> &[PathBuf]
Model weights files (multiple files supported).
Sourcefn get_config_filename(&self) -> &PathBuf
fn get_config_filename(&self) -> &PathBuf
Retrieve the PretrainedConfig
file.
Sourcefn get_tokenizer_filename(&self) -> &PathBuf
fn get_tokenizer_filename(&self) -> &PathBuf
A serialised tokenizers.Tokenizer
HuggingFace object.
Sourcefn get_template_filename(&self) -> &Option<PathBuf>
fn get_template_filename(&self) -> &Option<PathBuf>
File where the content is expected to deserialize to ChatTemplate
.
Sourcefn get_gen_conf_filename(&self) -> Option<&PathBuf>
fn get_gen_conf_filename(&self) -> Option<&PathBuf>
Filepath for general model configuration.
Sourcefn get_preprocessor_config(&self) -> &Option<PathBuf>
fn get_preprocessor_config(&self) -> &Option<PathBuf>
Get the preprocessor config (for the vision models). This is used to pre process images.
Sourcefn get_processor_config(&self) -> &Option<PathBuf>
fn get_processor_config(&self) -> &Option<PathBuf>
Get the processor config (for the vision models). This is primarily used for the chat template.
Sourcefn get_chat_template_explicit(&self) -> &Option<PathBuf>
fn get_chat_template_explicit(&self) -> &Option<PathBuf>
Get the explicit chat template.
Sourcefn get_adapter_paths(&self) -> &AdapterPaths
fn get_adapter_paths(&self) -> &AdapterPaths
Get adapter paths.