-
Notifications
You must be signed in to change notification settings - Fork 11k
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
feat: Implements retrying logic for downloading models using --model-url flag #9255
Conversation
Co-authored-by: Xuan Son Nguyen <[email protected]>
Co-authored-by: Xuan Son Nguyen <[email protected]>
@ngxson |
I would also appreciate if someone can help me to fix the |
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 would suggest extracting the retry logic to a function rather than duplicating the code.
I agree on that. Do you suggest I do it in this PR or do it later? I think approving will be required again after i apply the change PS: Done 😄 |
a032b0b
to
192d4df
Compare
e12b07e
to
c8f2890
Compare
@ngxson Please update your review. |
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.
Thanks. I'll merge when CI passes
…url flag (ggml-org#9255) * feat: Implements retrying logic for downloading models using --model-url flag * Update common/common.cpp Co-authored-by: Xuan Son Nguyen <[email protected]> * Update common/common.cpp Co-authored-by: Xuan Son Nguyen <[email protected]> * apply comments * implements a retry function to avoid duplication * fix editorconfig * change function name --------- Co-authored-by: farbod <[email protected]> Co-authored-by: Xuan Son Nguyen <[email protected]> Co-authored-by: slaren <[email protected]> Co-authored-by: Xuan Son Nguyen <[email protected]>
…url flag (ggml-org#9255) * feat: Implements retrying logic for downloading models using --model-url flag * Update common/common.cpp Co-authored-by: Xuan Son Nguyen <[email protected]> * Update common/common.cpp Co-authored-by: Xuan Son Nguyen <[email protected]> * apply comments * implements a retry function to avoid duplication * fix editorconfig * change function name --------- Co-authored-by: farbod <[email protected]> Co-authored-by: Xuan Son Nguyen <[email protected]> Co-authored-by: slaren <[email protected]> Co-authored-by: Xuan Son Nguyen <[email protected]>
…url flag (ggml-org#9255) * feat: Implements retrying logic for downloading models using --model-url flag * Update common/common.cpp Co-authored-by: Xuan Son Nguyen <[email protected]> * Update common/common.cpp Co-authored-by: Xuan Son Nguyen <[email protected]> * apply comments * implements a retry function to avoid duplication * fix editorconfig * change function name --------- Co-authored-by: farbod <[email protected]> Co-authored-by: Xuan Son Nguyen <[email protected]> Co-authored-by: slaren <[email protected]> Co-authored-by: Xuan Son Nguyen <[email protected]>
This PR implements the improvement requested at #6288, the approach is simple and uses a while loop for retrying with exponential backoff.
I found two calls to
curl_easy_perform
which is the function responsible for transferring the data, and on the call sites, I added the while loop for retrying on the condition of failing.For now, the retry count is fixed as a local variable inside the function, but passing the retry count as a CLI argument can further improve this feature.
I compiled the project after the changes with
make LLAMA_CURL=1
and tested it both with and without internet connection and it worked okay.It's my first time working with
curl
API in cpp so any suggestion for improvement is appreciated.