-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try to improve the printing for cached downloads from kaggle/colab #142
Conversation
Alternately we could figure out a way to only log each asset once, if it is found in the cache. That seems slightly misleading, as IIUC the whole directory is just mounted once, not asset by asset. And it would involve some state to track which call is the first download call for each asset. |
@@ -65,8 +65,6 @@ def __call__(self, h: ModelHandle, path: Optional[str] = None, *, force_download | |||
if not os.path.exists(cached_path): | |||
# Only print this if the model is not already mounted. | |||
logger.info(f"Mounting files to {cached_path}...", extra={**EXTRA_CONSOLE_BLOCK}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - It was only supposed to log if the cache is not found. I must have flipped the branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattdangerw Can you remove the extra={**EXTRA_CONSOLE_BLOCK}
at line 67 and add it at line 69 instead. No need to delete line 69.
This means the log will be logged to a file but not shown to the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattdangerw, whenever you get a chance to implement the change ^^, we can include it in our next release: #143
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done! I think. take a look.
/gcbrun |
/gcbrun |
This is an attempt to fix this issue when running kagglehub from a cache.
I don't think we want to log as if we are attaching an asset every time we read something from the cache.
kagglehub
for the same asset multiple times, it shouldn't "attach" each time (nor does it).