Skip to content

Commit

Permalink
fix image load
Browse files Browse the repository at this point in the history
  • Loading branch information
ZX-ModelCloud committed Dec 19, 2024
1 parent 075aa89 commit d65b098
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/models/ovis_calibration_dataset.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os.path
from typing import Dict, Sequence, Union, List
import copy
import logging
Expand Down Expand Up @@ -42,7 +43,7 @@ def __len__(self):
def __getitem__(self, i: int) -> Dict[str, torch.Tensor]:
sample = self.data[i]
conversations = copy.deepcopy(sample["conversations"])
images = [Image.open("./images/" + sample['id'])]
images = [Image.open(os.path.join(self.model.model_id_or_path, f"images/{sample['id']}"))]
max_partition = 9

prompt, input_ids, pixel_values, labels = self.model.preprocess_inputs(
Expand Down

0 comments on commit d65b098

Please sign in to comment.