-
Notifications
You must be signed in to change notification settings - Fork 106
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
fix(huggingface): wrap HfFileSystem to an async filesystem #957
Open
skshetry
wants to merge
4
commits into
main
Choose a base branch
from
cache-hfs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit wraps the HfFileSystem class to convert to an async filesystem. This is done by using the `AsyncFileSystemWrapper` class from the `fsspec` library, which requires `fsspec>=2024.12.0`. With the wrapper, all the functions will run in a separate thread in an executor, and won't block the main event-loop. This will now support all the async APIs that the `Client` expects, and will hence support caching of the files. The alternative here is to have two different implementations, one async and another sync, but that is too much of an effort at this time. Fixes #661.
Deploying datachain-documentation with
|
Latest commit: |
0c98175
|
Status: | ✅ Deploy successful! |
Preview URL: | https://09d709ff.datachain-documentation.pages.dev |
Branch Preview URL: | https://cache-hfs.datachain-documentation.pages.dev |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #957 +/- ##
==========================================
- Coverage 87.66% 87.65% -0.01%
==========================================
Files 131 131
Lines 11903 11904 +1
Branches 1623 1622 -1
==========================================
Hits 10435 10435
- Misses 1058 1059 +1
Partials 410 410
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Other jobs were noop, as token was not being set.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit wraps the HfFileSystem class to convert to an async filesystem. This is done by using the
AsyncFileSystemWrapper
class from thefsspec
library, which requiresfsspec>=2024.12.0
.With the wrapper, all the functions will run in a separate thread in an executor, and won't block the main event-loop.
This will now support all the async APIs that the
Client
expects and, hence, will support file caching.The alternative here is to have two different implementations, one async and another sync, but that is too much of an effort at this time for huggingface.
Fixes #661.