Skip to content

Commit 5ced790

Browse files
committed
fix(chat): 为 minijinja 打开内置函数和测试支持
Signed-off-by: YdrMaster <ydrml@hotmail.com>
1 parent d25e5d1 commit 5ced790

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

gguf/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ authors = ["YdrMaster <ydrml@hotmail.com>"]
66

77
[dependencies]
88
ggus.workspace = true
9-
minijinja = { version = "2.7", default-features = false, features = ["loader"] }
9+
minijinja = { version = "2.7", default-features = false, features = [
10+
"loader",
11+
"builtins",
12+
] }
1013
serde = { version = "1.0", features = ["derive"] }
1114
tokeneer = "0.0"
1215
memmap2 = "0.9"

gguf/src/chat_template.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl Drop for ChatTemplate {
8888
}
8989

9090
static JINJA_ENV: LazyLock<RwLock<Environment<'_>>> = LazyLock::new(|| {
91-
let mut env = Environment::empty();
91+
let mut env = Environment::new();
9292
env.set_unknown_method_callback(|_, value, method, args| {
9393
use minijinja::{value::ValueKind as ThisType, ErrorKind::UnknownMethod, Value};
9494
match (method, value.kind(), args) {

0 commit comments

Comments
 (0)