Skip to content

Commit e7329fe

Browse files
authored
Fixing the router + template for Qwen3. (#3200)
1 parent 39cfe23 commit e7329fe

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

router/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ pub enum Config {
414414
T5,
415415
DeepseekV2,
416416
DeepseekV3,
417+
Qwen3,
417418
}
418419

419420
#[derive(Clone, Debug, Serialize, Deserialize)]

router/src/infer/chat_template.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ impl ChatTemplate {
4141
"messages[0]['content'][0]['text']",
4242
"messages[0]['content']",
4343
);
44+
// Hack to fix Qwen3 templating.
45+
// It uses python notation to reverse lists, which do not exist in minijinja
46+
// so we're using the reverse filter instead.
47+
let mutated_template = mutated_template.replace("[::-1]", "|reverse");
4448

4549
let template_str = mutated_template.into_boxed_str();
4650
env.add_function("raise_exception", raise_exception);

0 commit comments

Comments
 (0)