mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-05-07 10:22:09 +00:00
Fixing the router + template for Qwen3. (#3200)
This commit is contained in:
parent
39cfe232fd
commit
e7329fec18
@ -414,6 +414,7 @@ pub enum Config {
|
|||||||
T5,
|
T5,
|
||||||
DeepseekV2,
|
DeepseekV2,
|
||||||
DeepseekV3,
|
DeepseekV3,
|
||||||
|
Qwen3,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
@ -41,6 +41,10 @@ impl ChatTemplate {
|
|||||||
"messages[0]['content'][0]['text']",
|
"messages[0]['content'][0]['text']",
|
||||||
"messages[0]['content']",
|
"messages[0]['content']",
|
||||||
);
|
);
|
||||||
|
// Hack to fix Qwen3 templating.
|
||||||
|
// It uses python notation to reverse lists, which do not exist in minijinja
|
||||||
|
// so we're using the reverse filter instead.
|
||||||
|
let mutated_template = mutated_template.replace("[::-1]", "|reverse");
|
||||||
|
|
||||||
let template_str = mutated_template.into_boxed_str();
|
let template_str = mutated_template.into_boxed_str();
|
||||||
env.add_function("raise_exception", raise_exception);
|
env.add_function("raise_exception", raise_exception);
|
||||||
|
Loading…
Reference in New Issue
Block a user