mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 12:24:53 +00:00
Fix test_chat_template_valid_with_strftime_now
This commit is contained in:
parent
3d132ab627
commit
1c17d8a768
@ -325,7 +325,8 @@ mod tests {
|
|||||||
|
|
||||||
let source = r#"
|
let source = r#"
|
||||||
{% set today = strftime_now("%Y-%m-%d") %}
|
{% set today = strftime_now("%Y-%m-%d") %}
|
||||||
{% set default_system_message = "The current date is " + today + ".\n" %}
|
{% set default_system_message = "The current date is " + today + "." %}
|
||||||
|
{{ default_system_message }}
|
||||||
{{ bos_token }}
|
{{ bos_token }}
|
||||||
{% if messages[0]['role'] == 'system' %}
|
{% if messages[0]['role'] == 'system' %}
|
||||||
{% set loop_messages = messages[1:] %}
|
{% set loop_messages = messages[1:] %}
|
||||||
@ -379,7 +380,7 @@ mod tests {
|
|||||||
|
|
||||||
let current_date = Local::now().format("%Y-%m-%d").to_string();
|
let current_date = Local::now().format("%Y-%m-%d").to_string();
|
||||||
let result = tmpl.unwrap().render(chat_template_inputs).unwrap();
|
let result = tmpl.unwrap().render(chat_template_inputs).unwrap();
|
||||||
assert_eq!(result, format!("The current date is {}. [BOS][INST] Hi! [/INST]Hello how can I help?[EOS][INST] What is Deep Learning? [/INST]magic![EOS]", current_date));
|
assert_eq!(result, format!("The current date is {}.[BOS][INST] Hi! [/INST]Hello how can I help?[EOS][INST] What is Deep Learning? [/INST]magic![EOS]", current_date));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user