chore: expand template benchmark coverage

This commit is contained in:
Evandro Fonseca Junior committed 2026-03-26 18:20:35 -03:00
1 parent bad2bb33a5
commit f96b42c356
5 files changed
+52 -2

No files matched your search

+38
View File
@@ -929,6 +929,44 @@ mod tests {
assert!(prepared.prompt.contains("[/INST]"));
}
#[test]
#[ignore = "autoresearch benchmark"]
fn dynamic_template_llama_family_combines_system_and_user_in_first_inst_block() {
let config = ServerConfig {
model_catalog: ModelCatalog::new("Meta-Llama-3-8B-Instruct".to_owned(), vec![]),
..base_config()
};
let request = parse_request(
r#"{
"model": "Meta-Llama-3-8B-Instruct",
"messages": [{"role":"user","content":"hello"}]
}"#,
);
let prepared = prepare_prompt(&request, &config);
assert!(prepared.prompt.contains("[INST] <<SYS>>"));
assert!(prepared.prompt.contains("hello [/INST]"));
assert_eq!(prepared.prompt.matches("[INST]").count(), 1);
}
#[test]
#[ignore = "autoresearch benchmark"]
fn dynamic_template_llama_family_does_not_end_with_open_inst_prefix() {
let config = ServerConfig {
model_catalog: ModelCatalog::new("Meta-Llama-3-8B-Instruct".to_owned(), vec![]),
..base_config()
};
let request = parse_request(
r#"{
"model": "Meta-Llama-3-8B-Instruct",
"messages": [{"role":"user","content":"hello"}]
}"#,
);
let prepared = prepare_prompt(&request, &config);
assert!(!prepared.prompt.ends_with("[INST] "));
}
#[test]
#[ignore = "autoresearch benchmark"]
fn dynamic_template_kimi_family_uses_moonshot_markers() {