#[non_exhaustive]pub enum Error {
TemplateRaised {
message: String,
},
Compile(Error),
Render(Error),
Config(String),
Hub(String),
}Expand description
Errors produced while compiling or rendering a chat template.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TemplateRaised
The template deliberately called raise_exception(msg) — the input conversation was
rejected by the template’s own validation (e.g. bad role alternation). Act on this;
it is not a bug.
Compile(Error)
The Jinja source failed to compile (syntax error). Carries the underlying engine error.
Render(Error)
The template failed at render time (undefined variable, type error, unknown method…).
Config(String)
The tokenizer_config.json had no usable chat_template, or a requested named
template was absent / the field had an unexpected shape.
Hub(String)
Fetching a file from the Hugging Face Hub failed (network, auth/gated repo, or the file
is absent). Only present with the hub feature. Carries the underlying message; the
hf-hub error type is deliberately kept out of our public API.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()