File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
backends/candle/src/models Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,15 @@ impl FlashQwen2Model {
264
264
ModelType :: Embedding ( pool) => pool,
265
265
} ;
266
266
267
- let vb = vb. pp ( "model" ) ;
267
+ // Pushing the prefix for `model` is apparently only required if the model architecture is
268
+ // ForCausalLM as it contains the `lm_head`, other than that, the `model` key won't be
269
+ // present e.g. a model without the `model` key as it's a `Qwen2Model` instance not a
270
+ // `Qwen2ModelForCausalLM` is https://huggingface.co/mims-harvard/ToolRAG-T1-GTE-Qwen2-1.5B
271
+ let vb = if vb. contains_tensor ( "model.embed_tokens.weight" ) {
272
+ vb. pp ( "model" )
273
+ } else {
274
+ vb
275
+ } ;
268
276
269
277
let embeddings = Embedding :: new (
270
278
vb. pp ( "embed_tokens" )
You can’t perform that action at this time.
0 commit comments