diff --git a/torchtext/experimental/datasets/sst2.py b/torchtext/experimental/datasets/sst2.py index a858a841e7..ad1038172c 100644 --- a/torchtext/experimental/datasets/sst2.py +++ b/torchtext/experimental/datasets/sst2.py @@ -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 @@ -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]