Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 033889b

Browse files
committed
conditional import
1 parent b646bac commit 033889b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

torchtext/datasets/amazonreviewpolarity.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
from torchdata.datapipes.iter import FileOpener, GDriveReader, IterableWrapper
1+
from torchtext._internal.module_utils import is_module_available
2+
3+
if is_module_available("torchdata"):
4+
from torchdata.datapipes.iter import FileOpener, GDriveReader, IterableWrapper
25

36
from torchtext.data.datasets_utils import (
47
_wrap_split_argument,

0 commit comments

Comments
 (0)