Skip to content

Commit

Permalink
Support both str and Path jsonl_path inputs in ImageCaptionJsonlDataset.
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanJDick committed Feb 12, 2024
1 parent d2c185e commit df50169
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ class ImageCaptionJsonlDataset(torch.utils.data.Dataset):
"""A dataset that loads images and captions from a directory of image files and .txt files."""

def __init__(
self, jsonl_path: Path, image_column: str = IMAGE_COLUMN_DEFAULT, caption_column: str = CAPTION_COLUMN_DEFAULT
self,
jsonl_path: Path | str,
image_column: str = IMAGE_COLUMN_DEFAULT,
caption_column: str = CAPTION_COLUMN_DEFAULT,
):
super().__init__()
self._jsonl_path = jsonl_path
self._jsonl_path = Path(jsonl_path)
self._image_column = image_column
self._caption_column = caption_column

Expand Down

0 comments on commit df50169

Please sign in to comment.