Skip to content

Commit 5e2afb7

Browse files
committed
Fix hash for VLM's language decoder to include qaic_config
Signed-off-by: quic-xiyushi <xiyushi@qti.qualcomm.com>
1 parent 3789d5a commit 5e2afb7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

QEfficient/transformers/models/modeling_auto.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -752,19 +752,22 @@ class QEffCausalLMForTextImageToTextModel(QEFFBaseModel):
752752
]
753753
_onnx_transforms = [FP16ClipTransform, SplitTensorsTransform]
754754

755-
def __init__(self, model, **kwargs):
755+
def __init__(self, model, qaic_config: Optional[dict] = None, **kwargs):
756756
"""
757757
Initializes the language decoder component for multimodal models.
758758
759759
Parameters
760760
----------
761761
model : nn.Module
762762
The full HuggingFace multimodal model from which the language decoder is extracted.
763+
qaic_config : dict, optional
764+
A dictionary for QAIC-specific configurations.
763765
**kwargs :
764766
Additional keyword arguments passed to the base class constructor.
765767
"""
766-
super().__init__(model, **kwargs)
768+
super().__init__(model, qaic_config=qaic_config, **kwargs)
767769
self.model = model.get_qeff_language_decoder()
770+
self.model.qaic_config = qaic_config
768771
self.hash_params["qeff_auto_class"] = self.__class__.__name__
769772

770773
def export(
@@ -936,9 +939,8 @@ def __init__(
936939
self.comp_ctx_lengths_prefill, self.comp_ctx_lengths_decode = process_ccl_specializations(qaic_config)
937940

938941
self.vision_model = QEffVisionEncoderForTextImageToTextModel(model, **kwargs)
939-
self.lang_model = QEffCausalLMForTextImageToTextModel(model, **kwargs)
942+
self.lang_model = QEffCausalLMForTextImageToTextModel(model, qaic_config=qaic_config, **kwargs)
940943
self.continuous_batching = continuous_batching
941-
self.lang_model.model.qaic_config = qaic_config
942944
self.input_shapes, self.output_names = None, None
943945
# ---Sampling---
944946
# Note: SamplerTransform should be applied after all other transforms

0 commit comments

Comments
 (0)