chore(downloader): support hf.co and hf:// URIs #4677
Merged
+15
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request includes updates to the
pkg/downloader/uri.go
file to support additional Hugging Face URL prefixes.Now:
hf.co/
, andhf://
are accepted URIs prefix as well.The changes include adding new constants for the prefixes, updating the URL detection logic, and modifying the URL resolution function to handle the new prefixes.
Support for additional Hugging Face URL prefixes:
pkg/downloader/uri.go
: Added new constantsHuggingFacePrefix1
andHuggingFacePrefix2
for additional Hugging Face URL formats.pkg/downloader/uri.go
: Updated theLooksLikeURL
function to recognize the new Hugging Face URL prefixes.pkg/downloader/uri.go
: Modified theResolveURL
function to handle and correctly resolve URLs with the new Hugging Face URL prefixes.Notes for Reviewers
Signed commits