Skip to content

Commit

Permalink
file to fsspec
Browse files Browse the repository at this point in the history
  • Loading branch information
ychfan committed Aug 18, 2023
1 parent 4afd1a1 commit d7e5997
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions video2dataset/dataloader/custom_wds.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter import IterableWrapper
from torch.utils.data.datapipes.utils.common import StreamWrapper
from torchdata.datapipes.iter import S3FileLoader, IterDataPipe, FileOpener
from torchdata.datapipes.iter import S3FileLoader, IterDataPipe, FSSpecFileOpener
from torchdata.datapipes.iter import TarArchiveLoader
from torchdata.datapipes.utils.common import validate_pathname_binary_tuple

Expand Down Expand Up @@ -532,7 +532,7 @@ def __init__(
main_datapipe = S3FileLoader(main_datapipe, buffer_size=buffer_size)
else:
# regular fileopener
main_datapipe = FileOpener(main_datapipe, mode="b")
main_datapipe = FSSpecFileOpener(main_datapipe, mode="b")
# adapted TarLoader which closes open tarfile handles after exceeding them
main_datapipe = TarArchiveLoaderAndCloser(datapipe=main_datapipe, handler=handler).groupby(grouper)
if sample_shuffle > 0:
Expand Down

0 comments on commit d7e5997

Please sign in to comment.