Skip to main content

resolve_model_name

Function resolve_model_name 

Source
pub fn resolve_model_name(
    gguf: Option<&GgufMetadata>,
    file_path: &Path,
    source: NameSource<'_>,
) -> String
Expand description

Resolve the models.name for a model being added.

The first non-blank rung wins:

  1. general.name from the GGUF header
  2. the HuggingFace repo’s short name, with the owner prefix and a trailing -GGUF stripped (only when source carries a repo id)
  3. the file stem
  4. UNKNOWN_MODEL_NAME