From 6f64f52f52686ea6c833ef3690c0867ccf56d2cc Mon Sep 17 00:00:00 2001 From: andrewkho Date: Wed, 11 Dec 2024 16:44:39 -0800 Subject: [PATCH] fix importguard --- torchtune/utils/_import_guard.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/torchtune/utils/_import_guard.py b/torchtune/utils/_import_guard.py index 5e6ab5309..582c79022 100644 --- a/torchtune/utils/_import_guard.py +++ b/torchtune/utils/_import_guard.py @@ -14,7 +14,10 @@ ) _TORCHDATA_MIN_VERSION = "0.10.0" -if importlib.util.find_spec("torchdata.nodes") is not None: +if ( + importlib.util.find_spec("torchdata") is not None + and importlib.util.find_spec("torchdata.nodes") is not None +): _TORCHDATA_INSTALLED = True else: _TORCHDATA_INSTALLED = False