Skip to content

Commit 4b67a79

Browse files
authored
correct handling of no-image case for qwen2-vl (#179)
- fixes #177
1 parent 82614ed commit 4b67a79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/MLXVLM/Models/Qwen2VL.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ public class Qwen2VL: Module, VLMModel, KVCacheDimensionProvider {
783783
-> MLXArray
784784
{
785785
guard let pixelValues, let gridThw else {
786-
return languageModel(inputIds).logits
786+
return languageModel.model.embedTokens(inputIds[.newAxis, .ellipsis])
787787
}
788788

789789
// Get the input embeddings from the language model

0 commit comments

Comments
 (0)