Skip to content
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

Draft: feat: introduce HFPath #422

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

bbtfr
Copy link
Member

@bbtfr bbtfr commented Nov 5, 2024

  1. 实现一个 fsspec.FileSystem 到 megfile.SmartPath 的 wrapper
  2. 通过上述实现适配 huggingface

TODO:

  1. 补测试

@bbtfr bbtfr marked this pull request as draft November 5, 2024 11:20
megfile/fsspec.py Fixed Show fixed Hide fixed
megfile/fsspec.py Fixed Show fixed Hide fixed
megfile/fsspec.py Fixed Show fixed Hide fixed
megfile/fsspec.py Fixed Show fixed Hide fixed
megfile/fsspec.py Fixed Show fixed Hide fixed
megfile/utils/__init__.py Fixed Show fixed Hide fixed
megfile/utils/__init__.py Fixed Show fixed Hide fixed
megfile/utils/__init__.py Fixed Show fixed Hide fixed
megfile/utils/__init__.py Fixed Show fixed Hide fixed
megfile/utils/__init__.py Fixed Show fixed Hide fixed
from typing import IO, BinaryIO, Callable, Iterator, List, Optional, Tuple

try:
import fsspec

Check failure

Code scanning / Pyre

Type Error Error

Undefined import [21]: Could not find a module corresponding to import fsspec.
megfile/fsspec.py Fixed Show fixed Hide fixed
megfile/utils/__init__.py Fixed Show fixed Hide fixed
@bbtfr bbtfr force-pushed the liyang/support-huggingface branch from 5c0fd78 to 20760de Compare November 20, 2024 04:44
megfile/utils/__init__.py Fixed Show fixed Hide fixed
@bbtfr bbtfr force-pushed the liyang/support-huggingface branch 3 times, most recently from c22ca8f to 719ac7a Compare November 20, 2024 05:03

class BaseFSSpecPath(URIPath):
protocol: str
filesystem: "fsspec.AbstractFileSystem"

Check failure

Code scanning / Pyre

Type Error Error

Undefined or invalid type [11]: Annotation fsspec.AbstractFileSystem is not defined as a type.
@bbtfr bbtfr force-pushed the liyang/support-huggingface branch from 719ac7a to 8ef3783 Compare November 20, 2024 05:11
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 39.61039% with 93 lines in your changes missing coverage. Please review.

Project coverage is 94.86%. Comparing base (ac08679) to head (7db4103).

Files with missing lines Patch % Lines
megfile/fsspec.py 35.43% 82 Missing ⚠️
megfile/hf_path.py 56.00% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #422      +/-   ##
==========================================
- Coverage   96.22%   94.86%   -1.37%     
==========================================
  Files          44       46       +2     
  Lines        6229     6383     +154     
==========================================
+ Hits         5994     6055      +61     
- Misses        235      328      +93     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@bbtfr bbtfr force-pushed the liyang/support-huggingface branch from 8ef3783 to 7db4103 Compare November 20, 2024 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant