Skip to content

Commit daa9e24

Browse files
committed
Removed partial changes done for Metaclass utilization to enforce from_pretrained based model creation. Will add that functionality separately after the hashing methodlogy is finalized.
Signed-off-by: Dhiraj Kumar Sah <[email protected]>
1 parent 2e8d8a1 commit daa9e24

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

QEfficient/transformers/models/modeling_auto.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ def auto_correct_inputs(self, inputs):
130130
return {k: v for k, v in inputs.items() if k in [iinfo.name for iinfo in inputs_info]}
131131

132132

133-
class NoInitMeta(type):
134-
def __call__(cls, *args, **kwargs):
135-
raise RuntimeError("Use `from_pretrained` to create an instance.")
136-
137-
138133
class QEFFAutoModel(QEFFTransformersBase):
139134
"""
140135
The QEFFAutoModel class is designed for manipulating any transformer model from the HuggingFace hub.
@@ -1181,7 +1176,6 @@ def get_model_config(self) -> dict:
11811176
return self.model.config.__dict__
11821177

11831178

1184-
# class QEFFAutoModelForImageTextToText(metaclass=NoInitMeta):
11851179
class QEFFAutoModelForImageTextToText:
11861180
"""
11871181
The QEFFAutoModelForImageTextToText class is used to work with multimodal language models from the HuggingFace hub.
@@ -1288,7 +1282,6 @@ def from_pretrained(cls, pretrained_model_name_or_path: str, kv_offload: Optiona
12881282
MISCLASSIFIED_CAUSAL_LM_TO_QEFF_AUTO_CLASS_MAP = {"InternVLChatModel": QEFFAutoModelForImageTextToText}
12891283

12901284

1291-
# class QEFFAutoModelForCausalLM(QEFFBaseModel, metaclass=NoInitMeta):
12921285
class QEFFAutoModelForCausalLM(QEFFBaseModel):
12931286
"""
12941287
The QEFF class is designed for manipulating any causal language model from the HuggingFace hub.

0 commit comments

Comments
 (0)