-
Notifications
You must be signed in to change notification settings - Fork 0
Add download retries #198
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
Add download retries #198
Conversation
src/together/lib/constants.py
Outdated
| DOWNLOAD_BLOCK_SIZE = 10 * 1024 * 1024 # 10 MB | ||
| DISABLE_TQDM = False | ||
| MAX_DOWNLOAD_RETRIES = 5 # Maximum retries for download failures | ||
| DOWNLOAD_RETRY_DELAY = 1.0 # Initial retry delay in seconds |
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.
I'd name DOWNLOAD_INITIAL_RETRY_DELAY according to the comment for consistency
src/together/lib/resources/files.py
Outdated
| try: | ||
| # If this is a retry, close the previous response and create a new one with Range header | ||
| if bytes_downloaded > 0: | ||
| if 'response' in locals(): |
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.
Can we do
response = None above the with tqdm to avoid using "locals" doing if response is None instead?
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 7. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
* feat(api): api update * chore(internal): add missing files argument to base client * feat(api): api update * Add progress bar for Fine-tuning API (#197) Add progress bar for FT * Add download retries (#198) * add download retries * feat(files): add support for string alternative to file upload type * release: 2.0.0-alpha.11 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Artem Chumachenko <[email protected]> Co-authored-by: Ruslan Khaidurov <[email protected]>
This PR
Adds retries for downloads, which is supposed to fix some issues with large files.