Skip to content

Commit ac8289a

Browse files
Merge pull request #95 from compling-wat/yifan-dev
Fixed handling of text-only inputs
2 parents 02fb113 + 2cb0a28 commit ac8289a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/models/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,11 @@ def _load_input_data(self) -> Iterator[ModelInput]:
358358
prompt = self._generate_prompt(row['prompt'])
359359
data = self._generate_processor_output(
360360
prompt=prompt,
361-
img_path=row['image']
361+
img_path=row['image'] if self.config.has_images() else None
362362
)
363363

364364
yield {
365-
'image': row['image'],
365+
'image': row['image'] if self.config.has_images() else self.config.NO_IMG_PROMPT,
366366
'prompt': row['prompt'],
367367
'label': row['label'] if 'label' in self.config.dataset.column_names else None,
368368
'data': data,

0 commit comments

Comments
 (0)