From d6621f9a2989618e243d16ffbc0a25648c62aba0 Mon Sep 17 00:00:00 2001 From: v-chen_data Date: Thu, 6 Jun 2024 16:54:16 -0700 Subject: [PATCH] move NotFound up --- llmfoundry/utils/config_utils.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/llmfoundry/utils/config_utils.py b/llmfoundry/utils/config_utils.py index 2a6d44b2af..ccc58f593b 100644 --- a/llmfoundry/utils/config_utils.py +++ b/llmfoundry/utils/config_utils.py @@ -698,6 +698,8 @@ def _verify_uc_path(path: str) -> bool: from databricks.sdk import WorkspaceClient w = WorkspaceClient() + w.files.get_metadata(path) + return True except ImportError: log.warning( 'Cannot verify the path of `UCVolumeDatasetSource` because of missing' + \ @@ -706,15 +708,11 @@ 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. ' f'Error details: {str(e)}. This does not block creating `UCVolumeDatasetSource`, ' f'but your `UCVolumeDatasetSource` might be invalid.', ) - - try: - w.files.get_metadata(path) - return True - except (NotFound, PermissionDenied): - return False