Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions torchtext/experimental/datasets/sst2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
)

if is_module_available("torchdata"):
from torchdata.datapipes.iter import IterableWrapper, FileLoader
from torchdata.datapipes.iter import IterableWrapper, FileOpener

# we import HttpReader from _download_hooks so we can swap out public URLs
# with interal URLs when the dataset is used within Facebook
Expand Down Expand Up @@ -90,7 +90,7 @@ def _get_datapipe(self, root, split, validate_hash):
cache_dp = HttpReader(cache_dp).end_caching(mode="wb", same_filepath_fn=True)

# Load from cached file
cache_dp = FileLoader(cache_dp, mode="rb")
cache_dp = FileOpener(cache_dp, mode="rb")
# extract data from zip
extracted_files = cache_dp.read_from_zip().filter(
lambda x: f"{split}.tsv" in x[0]
Expand Down