Skip to main content

load_model_chat_template

Function load_model_chat_template 

Source
pub fn load_model_chat_template(
    snapshot_path: &Path,
) -> Option<ModelChatTemplate>
Expand description

Load a model-provided chat template, if the source carries one.

GGUF stores this in tokenizer.chat_template; HuggingFace snapshots commonly store it in chat_template.jinja, chat_template.json, or tokenizer_config.json. The renderer may still fall back if a template uses unsupported Jinja features, but callers should always prefer this metadata over model-name heuristics.