Skip to content

Conversation

hoytak
Copy link
Collaborator

@hoytak hoytak commented May 7, 2025

This PR connects detailed upload progress to the hub in a backwards compatible way.

It works by testing the number of arguments and argument names on the progress updating function. If the progress reporting function takes a single argument, this function calls it using the old method; if it has the appropriate arguments for detailed reporting -- item_id, completed_bytes, total_bytes, update_increment -- then it calls it using the new method. Additionally, if None is passed in, the progress reporting is disabled.

@hoytak hoytak requested a review from seanses May 7, 2025 22:38
@hoytak
Copy link
Collaborator Author

hoytak commented May 7, 2025

This PR has been tested and verified on a draft implementation in huggingface_hub; I want to get it in now before I put up a PR there.

@hoytak hoytak merged commit 0ba75fe into main May 8, 2025
4 checks passed
@hoytak hoytak deleted the hoytak/250507-connect-detailed-progress-to-hub branch May 8, 2025 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants