diff --git a/gptqmodel/models/definitions/ovis.py b/gptqmodel/models/definitions/ovis.py index ccb0cdbba..9171ad7c1 100644 --- a/gptqmodel/models/definitions/ovis.py +++ b/gptqmodel/models/definitions/ovis.py @@ -26,7 +26,7 @@ class OvisGPTQ(BaseGPTQModel): IGNORE_ID = -100 - def preprocess_inputs(self, sample: Dict) -> Dict: + def preprocess_dataset(self, sample: Dict) -> Dict: text_max_length = 832 conversations = copy.deepcopy(sample["conversations"]) images = [fetch_image(sample)] @@ -59,7 +59,7 @@ def prepare_dataset( batch_size: int = 1, tokenizer=None, ): calib_data = [] - for batch in batched(calibration_dataset, batch_size, self.preprocess_inputs): + for batch in batched(calibration_dataset, batch_size, self.preprocess_dataset): pixel_values, input_ids, labels = tuple([instance[key] for instance in batch] for key in ("pixel_values", "input_ids", "labels")) input_ids = torch.nn.utils.rnn.pad_sequence( diff --git a/gptqmodel/models/definitions/qwen2_vl.py b/gptqmodel/models/definitions/qwen2_vl.py index aaba20724..e00046b45 100644 --- a/gptqmodel/models/definitions/qwen2_vl.py +++ b/gptqmodel/models/definitions/qwen2_vl.py @@ -58,7 +58,7 @@ class Qwen2VLGPTQ(BaseGPTQModel): } } - def preprocess_inputs(self, sample: Dict) -> Dict: + def preprocess_dataset(self, sample: Dict) -> Dict: return sample def prepare_dataset( @@ -68,7 +68,7 @@ def prepare_dataset( tokenizer=None, ): processor = Qwen2VLProcessor.from_pretrained(self.model_id_or_path) calib_data = [] - for batch in batched(calibration_dataset, batch_size, process_func=self.preprocess_inputs): + for batch in batched(calibration_dataset, batch_size, process_func=self.preprocess_dataset): text = processor.apply_chat_template( batch, tokenize=False, add_generation_prompt=True )