fix: 4096 - failed to get huggingface models #4133
Merged
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.
Describe Your Changes
Results
Fast model repo information display, consistent from repo to repo
Only 1 request sent to get all file sizes
Fixes Issues
My Models
page #4096Changes made
The code changes involve the removal and refactoring of the
getFileSize
function across the codebase:Tests:
getFileSize
unit test fromcore.test.ts
anddownload.test.ts
.Core Functionality:
getFileSize
function definition fromcore.ts
and its export statement. The associated API endpoint reference in theDownloadRoute
enum has also been removed.Downloader Class:
getFileSize
method indownload.ts
has been removed. Previously, it used therequest
library to fetch file sizes using HTTP HEAD requests.Hugging Face Integration:
getFileSize
inhuggingface.ts
and its related mock inhuggingface.test.ts
have been removed.fetch
call to retrieve the file tree, including sizes, instead of individually callinggetFileSize
.UI Messaging:
ModelSearch/index.tsx
, providing more user-friendly feedback regarding potential rate limiting.Overall, the refactor centralizes file size retrieval to a single network call using existing repository data, reducing reliance on redundant and potentially heavy individual requests.