Skip to content

Commit 3191f17

Browse files
committed
Switching to use FileOpener from FileLoader
ghstack-source-id: ddfd612 Pull Request resolved: #1483
1 parent be7bc66 commit 3191f17

File tree

1 file changed

+2
-2
lines changed
  • torchtext/experimental/datasets

1 file changed

+2
-2
lines changed

torchtext/experimental/datasets/sst2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
)
1111

1212
if is_module_available("torchdata"):
13-
from torchdata.datapipes.iter import IterableWrapper, FileLoader
13+
from torchdata.datapipes.iter import IterableWrapper, FileOpener
1414

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

9292
# Load from cached file
93-
cache_dp = FileLoader(cache_dp, mode="rb")
93+
cache_dp = FileOpener(cache_dp, mode="rb")
9494
# extract data from zip
9595
extracted_files = cache_dp.read_from_zip().filter(
9696
lambda x: f"{split}.tsv" in x[0]

0 commit comments

Comments
 (0)