diff --git a/llmfoundry/utils/config_utils.py b/llmfoundry/utils/config_utils.py index ccc58f593b..7a6cf3524b 100644 --- a/llmfoundry/utils/config_utils.py +++ b/llmfoundry/utils/config_utils.py @@ -700,6 +700,12 @@ def _verify_uc_path(path: str) -> bool: w = WorkspaceClient() w.files.get_metadata(path) return True + except (NotFound, PermissionDenied): + try: + w.files.get_directory_metadata(self.path) + except Exception: + # Neither file nor directory exists, we throw an exception. + return False except ImportError: log.warning( 'Cannot verify the path of `UCVolumeDatasetSource` because of missing' + \ @@ -708,8 +714,6 @@ def _verify_uc_path(path: str) -> bool: '`UCVolumeDatasetSource`, but your `UCVolumeDatasetSource` might be invalid.', ) return False - except (NotFound, PermissionDenied): - return False except Exception as e: log.warning( f'Cannot verify the path of `UCVolumeDatasetSource` due to an error. '