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

Deprecate ModelFilter/DatasetFilter #2028

Merged

Conversation

druvdub
Copy link
Contributor

@druvdub druvdub commented Feb 15, 2024

Related to #1676

Moved all attributes from ModelFilter class to list_models arguments and added a filter query builder to build a query. Updated list_models to take both filter as an Iterable and also update the filter list based on other arguments in the method

…method

Moved all attributes from ModelFilter class to list_models arguments and added a filter query builder to build a query.
Updated list_models to take both filter as an Iterable and also update the filter list based on other arguments in the method
@druvdub druvdub marked this pull request as draft February 15, 2024 01:53
@Wauplin
Copy link
Contributor

Wauplin commented Feb 15, 2024

Hi @druvdub! Thanks for the PR ❤️ I've tried to answer all of your questions in #1676 (comment). Please let me know if some parts are still unclear :)

Regarding this PR, would it be possible to fix the styling? The PR change diff is very big at the moment due to some whitespaces/newlines added or removed. This makes the PR quite difficult to review. You can fix this with the following steps:

  1. install the dev dependencies:
pip install -e ".[dev]"
  1. run the make style command (which runs ruff linter and formatter + a few scripts)
make style
  1. (optional) once done, you should be able to run run quality without any error (checks styling + type annotations):
make quality

I believe the current changes were due to a "autoformat" or "format on save" feature in your IDE. Make sure to always run make style before committing changes :) Thanks in advance!

@druvdub druvdub changed the title Deprecate ModelFilter/DatasetFilter Deprecate ModelFilter/DatasetFilter Feb 15, 2024
@druvdub
Copy link
Contributor Author

druvdub commented Feb 15, 2024

Hi @druvdub! Thanks for the PR ❤️ I've tried to answer all of your questions in #1676 (comment). Please let me know if some parts are still unclear :)

Regarding this PR, would it be possible to fix the styling? The PR change diff is very big at the moment due to some whitespaces/newlines added or removed. This makes the PR quite difficult to review. You can fix this with the following steps:

  1. install the dev dependencies:
pip install -e ".[dev]"
  1. run the make style command (which runs ruff linter and formatter + a few scripts)
make style
  1. (optional) once done, you should be able to run run quality without any error (checks styling + type annotations):
make quality

I believe the current changes were due to a "autoformat" or "format on save" feature in your IDE. Make sure to always run make style before committing changes :) Thanks in advance!

Yup no worries, for some reason the makefile did not work, So I had to now manually run the ruff checks

@druvdub
Copy link
Contributor Author

druvdub commented Feb 15, 2024

@Wauplin I think this should be all in terms of functionality changes.

Should I update READMEs and completely remove ModelFilter/DatasetFilter because I believe it might affect the hf_api docs

And finally in terms of test changes should I just update the existing tests to take arguments instead of ModelFilter/DatasetFilter or write some completely new ones

@Wauplin
Copy link
Contributor

Wauplin commented Feb 15, 2024

Thanks for all the modifications and taking care of the special cases @druvdub! I'll have a look at it on tomorrow if that's fine with you :)

@druvdub
Copy link
Contributor Author

druvdub commented Feb 15, 2024

Thanks for all the modifications and taking care of the special cases @druvdub! I'll have a look at it on tomorrow if that's fine with you :)

Yea sounds good to me :)

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.

Thanks for the PR @druvdub! Logic-wise it looks good to me! 🔥 I left a couple of comments regarding the code + API but overall very nice one :) Once addressed, we will have to review some tests, especially if ModelFilter / DatasetFilter are used (since deprecation warning make the CI fail, on purpose). I can help on this part if needed (we have a expect_deprecation decorator for tests that are meant to break).

src/huggingface_hub/hf_api.py Outdated Show resolved Hide resolved
src/huggingface_hub/utils/endpoint_helpers.py Outdated Show resolved Hide resolved
src/huggingface_hub/utils/endpoint_helpers.py Outdated Show resolved Hide resolved
src/huggingface_hub/utils/endpoint_helpers.py Outdated Show resolved Hide resolved
src/huggingface_hub/utils/endpoint_helpers.py Outdated Show resolved Hide resolved
src/huggingface_hub/hf_api.py Outdated Show resolved Hide resolved
src/huggingface_hub/hf_api.py Outdated Show resolved Hide resolved
src/huggingface_hub/hf_api.py Outdated Show resolved Hide resolved
src/huggingface_hub/hf_api.py Outdated Show resolved Hide resolved
src/huggingface_hub/hf_api.py Outdated Show resolved Hide resolved
@Wauplin Wauplin marked this pull request as ready for review February 16, 2024 10:30
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@druvdub
Copy link
Contributor Author

druvdub commented Feb 16, 2024

Thanks for the PR @druvdub! Logic-wise it looks good to me! 🔥 I left a couple of comments regarding the code + API but overall very nice one :) Once addressed, we will have to review some tests, especially if ModelFilter / DatasetFilter are used (since deprecation warning make the CI fail, on purpose). I can help on this part if needed (we have a expect_deprecation decorator for tests that are meant to break).

Hey @Wauplin I have addressed all the comments so far, and hopefully I can look at the tests now.

In the meantime, is this expected?
image

And similarly do we need to update the README.md files as well

UPDATE:
the tests do fail, I can use the decorator but what I am thinking about are the additional scenarios
where we pass the the filter keyword arguments and ModelFilter as well. Do we need them assuming ModelFilter will be removed in sometime

Wauplin added a commit to Wauplin/lm-question-generation that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/alexandra_ai_eval that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/llmware that referenced this pull request Aug 13, 2024
…lFilter`)

This PR remove deprecated import of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/stable-diffusion-cust that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/Fengshenbang-LM that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/grazier that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/lm-vocab-trimmer that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/langroid that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/audio-webui that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/Chat-Haruhi-Suzumiya that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/LLM4SE that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/KVQuant that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
Wauplin added a commit to Wauplin/argilla-streamlit that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
carson-katri pushed a commit to carson-katri/dream-textures that referenced this pull request Aug 13, 2024
Hello 👋

This PR updates some attributes and methods that are now deprecated in the `huggingface_hub` library.

- `modelId` is getting deprecated huggingface/huggingface_hub#2408
- `ModelFilter` has been deprecated for some time (see huggingface/huggingface_hub#2028)

This PR will make the codebase more future-proof while being compatible with existing versions of `huggingface_hub`. Let me know if you have any questions 🤗
pchalasani added a commit to langroid/langroid that referenced this pull request Aug 13, 2024
* Update hf_formatter.py (remove deprecated use of `ModelFilter`)

This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.

* fix: hf_formatter.py continue if exception

---------

Co-authored-by: Prasad Chalasani <[email protected]>
DavidMChan pushed a commit to DavidMChan/grazier that referenced this pull request Aug 13, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
dieharders pushed a commit to dieharders/obrew-studio-server that referenced this pull request Aug 14, 2024
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
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.

3 participants