Skip to content

Commit 629b32d

Browse files
committed
Push model prefix from VarBuilder if Qwen3-Reranker
1 parent 4f4958f commit 629b32d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

backends/candle/src/models/flash_qwen3.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,14 @@ impl FlashQwen3Model {
308308
ModelType::Embedding(pool) => pool,
309309
};
310310

311+
// The Qwen3-Reranker models contain the `model` key
312+
// https://huggingface.co/collections/Qwen/qwen3-reranker-6841b22d0192d7ade9cdefea
313+
let vb = if vb.contains_tensor("model.embed_tokens.weight") {
314+
vb.pp("model")
315+
} else {
316+
vb
317+
};
318+
311319
let embeddings = Embedding::new(
312320
vb.pp("embed_tokens")
313321
.get((config.vocab_size, config.hidden_size), "weight")?,
@@ -497,6 +505,7 @@ impl Model for FlashQwen3Model {
497505
fn is_padded(&self) -> bool {
498506
false
499507
}
508+
500509
fn embed(&self, batch: Batch) -> Result<(Option<Tensor>, Option<Tensor>)> {
501510
self.forward(batch)
502511
}

0 commit comments

Comments
 (0)