Skip to content

Commit e877271

Browse files
b/303240466#comment21 - make logging message consistent with Kaggle (#77)
b/303240466#comment21
1 parent ec7ca5a commit e877271

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/kagglehub/colab_cache_resolver.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ def __call__(self, h: ModelHandle, path: Optional[str] = None, *, force_download
4141
if force_download:
4242
logger.warning("Ignoring invalid input: force_download flag cannot be used in a Colab notebook")
4343

44-
logger.info(f"Attaching model '{h}' to your Colab notebook...")
44+
if path:
45+
logger.info(f"Attaching '{path}' from model '{h}' to your Colab notebook...")
46+
else:
47+
logger.info(f"Attaching model '{h}' to your Colab notebook...")
4548

4649
api_client = ColabClient()
4750
data = {
@@ -63,7 +66,7 @@ def __call__(self, h: ModelHandle, path: Optional[str] = None, *, force_download
6366

6467
base_mount_path = os.getenv(COLAB_CACHE_MOUNT_FOLDER_ENV_VAR_NAME, DEFAULT_COLAB_CACHE_MOUNT_FOLDER)
6568
cached_path = f"{base_mount_path}/{response['slug']}"
66-
logger.info(f"Model '{h}' is attached.")
69+
6770
if path:
6871
cached_filepath = f"{cached_path}/{path}"
6972
if not os.path.exists(cached_filepath):

0 commit comments

Comments
 (0)