fix: adjust for idefics2 template

This commit is contained in:
drbh 2024-05-27 03:59:47 +00:00
parent 93409ea038
commit dd696891ac

View File

@ -101,7 +101,10 @@ impl Infer {
})
.map(|t| {
// .strip() is not supported in minijinja
let t = t.replace(".strip()", " | trim");
// .capitalize() is not supported in minijinja but we can use | capitalize
let t = t
.replace(".strip()", " | trim")
.replace(".capitalize()", " | capitalize");
ChatTemplate::new(t, tokenizer_config.bos_token, tokenizer_config.eos_token)
});