[package]
edition = "2021"
rust-version = "1.85"
name = "hf-chat-template"
version = "0.2.1"
build = false
exclude = [
"tests/corpus/",
"tests/m3_corpus.rs",
"tests/hub.rs",
"tools/",
".github/",
"SPEC.md",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Render Hugging Face chat_template (Jinja2) prompts byte-identically to transformers.apply_chat_template."
readme = "README.md"
keywords = [
"chat-template",
"huggingface",
"transformers",
"jinja",
"llm",
]
categories = [
"text-processing",
"template-engine",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/GregoryBolshakov/hf-chat-template"
[package.metadata.docs.rs]
all-features = true
[features]
default = ["pycompat"]
hub = ["dep:hf-hub"]
pycompat = ["dep:minijinja-contrib"]
strftime = ["dep:chrono"]
[lib]
name = "hf_chat_template"
path = "src/lib.rs"
[[test]]
name = "m0_spikes"
path = "tests/m0_spikes.rs"
[[test]]
name = "m1_core"
path = "tests/m1_core.rs"
[[test]]
name = "m2_model"
path = "tests/m2_model.rs"
[[test]]
name = "panic_safety"
path = "tests/panic_safety.rs"
[dependencies.chrono]
version = "0.4"
features = ["clock"]
optional = true
default-features = false
[dependencies.hf-hub]
version = "0.5"
features = ["ureq"]
optional = true
default-features = false
[dependencies.minijinja]
version = "2.20"
features = [
"json",
"loop_controls",
"preserve_order",
]
[dependencies.minijinja-contrib]
version = "2.20"
features = ["pycompat"]
optional = true
[dependencies.serde]
version = "1"
features = ["derive"]
[dependencies.serde_json]
version = "1.0.150"
features = ["preserve_order"]
[dev-dependencies.serde_json]
version = "1.0.150"
features = ["preserve_order"]