Skip to content

Commit 47dd748

Browse files
committed
Fix for review comments 2
Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
1 parent 450c8d6 commit 47dd748

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

QEfficient/generation/embedding_handler.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,14 @@ def prepare_vlm_inputs(self, image_url: str, query: str, prefill_seq_len: int) -
252252

253253
# Process image and text
254254
inputs = self._processor(images=image, text=prompt, return_tensors="pt")
255-
if (hasattr(self._qeff_model.model.config, "model_type")and self._qeff_model.model.config.model_type in {"qwen2_5_vl", "qwen3_vl_moe", "qwen3_vl"}):
255+
if hasattr(self._qeff_model.model.config, "model_type") and self._qeff_model.model.config.model_type in {
256+
"qwen2_5_vl",
257+
"qwen3_vl_moe",
258+
"qwen3_vl",
259+
}:
256260
inputs = self._qeff_model.model.prepare_inputs_for_generation(
257-
inputs=inputs, prefill_seq_len=prefill_seq_len, batch_size=inputs["input_ids"].shape[0]
258-
)
261+
inputs=inputs, prefill_seq_len=prefill_seq_len, batch_size=inputs["input_ids"].shape[0]
262+
)
259263

260264
# Convert to float32 if needed
261265
if "pixel_values" in inputs:

QEfficient/generation/vlm_generation.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ def __init__(
146146
)
147147

148148
# Vision-specific initialization
149-
self.is_qwen_vl = (hasattr(qeff_model.model.config, "model_type")and qeff_model.model.config.model_type in {"qwen2_5_vl", "qwen3_vl_moe", "qwen3_vl"})
149+
self.is_qwen_vl = hasattr(qeff_model.model.config, "model_type") and qeff_model.model.config.model_type in {
150+
"qwen2_5_vl",
151+
"qwen3_vl_moe",
152+
"qwen3_vl",
153+
}
150154
self.qeff_model = qeff_model
151155
self.processor = processor
152156
self.tokenizer = tokenizer
@@ -280,7 +284,6 @@ def update_decode_inputs_qwen_vl(self, outputs, position_ids, generation_len, de
280284
self.generation_len[decode_batch_id or slice(None)] = generation_len
281285
return next_token_id
282286

283-
284287
def _execute_chunked_prefill(
285288
self,
286289
lang_inputs: Dict[str, np.ndarray],

QEfficient/transformers/cache_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ def update3D(
429429
self.append_new_layers(layer_idx)
430430
return self.layers[layer_idx].update3D(key_states, value_states, cache_kwargs)
431431

432-
433432

434433
class QEffEncoderDecoderCache(EncoderDecoderCache):
435434
"""

0 commit comments

Comments
 (0)