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

Faster HfFileSystem.glob #1815

Merged
merged 24 commits into from
Nov 13, 2023
Merged

Faster HfFileSystem.glob #1815

merged 24 commits into from
Nov 13, 2023

Conversation

lhoestq
Copy link
Member

@lhoestq lhoestq commented Nov 10, 2023

Following #1809

I added the expand_infoargument to _ls_tree instead of detail (it always returns dicts anyway) so that glob can still pass detail=True but with expand_info=False.

I also replaced the detail argument in info() with this one, since info() always return a dict anyway (which is consistent with detail=True).

(also let me know if you prefer naming the new argument expand instead of expand_info for consistency with the Hub API)

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 10, 2023

The documentation is not available anymore as the PR was closed or merged.

Base automatically changed from faster-hffs-find to main November 10, 2023 14:23
Copy link
Contributor

@mariosasko mariosasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expand_info is more descriptive, so I slightly prefer it over expand

src/huggingface_hub/hf_file_system.py Outdated Show resolved Hide resolved
@lhoestq lhoestq marked this pull request as ready for review November 10, 2023 17:25
@lhoestq lhoestq marked this pull request as draft November 10, 2023 17:27
@lhoestq lhoestq marked this pull request as ready for review November 10, 2023 18:06
Copy link
Contributor

@mariosasko mariosasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! So this PR is essentially to not fetch details by default in glob right? All the rest is only renaming variables?

@lhoestq
Copy link
Member Author

lhoestq commented Nov 13, 2023

Yes exactly :) I think datasets will use glob(..., detail=True, expand_info=False)

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.

4 participants