Skip to content

Commit

Permalink
Bump to 0.24 + remove deprecated code (#2287)
Browse files Browse the repository at this point in the history
* Bump to 0.24 + remove deprecated code

* remove ModelFilter/DatasetFilter from KO docs
  • Loading branch information
Wauplin committed May 28, 2024
1 parent 8873deb commit bb38f94
Show file tree
Hide file tree
Showing 7 changed files with 197 additions and 583 deletions.
16 changes: 4 additions & 12 deletions docs/source/en/guides/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,13 @@ The list helpers have several attributes like:
- `search`
- ...

Two of these parameters are intuitive (`author` and `search`), but what about that `filter`?
`filter` takes as input a [`ModelFilter`] object (or [`DatasetFilter`]). You can instantiate
it by specifying which models you want to filter.

Let's see an example to get all models on the Hub that does image classification, have been
trained on the imagenet dataset and that runs with PyTorch. That can be done with a single
[`ModelFilter`]. Attributes are combined as "logical AND".
Let's see an example to get all models on the Hub that does image classification, have been trained on the imagenet dataset and that runs with PyTorch.

```py
models = hf_api.list_models(
filter=ModelFilter(
task="image-classification",
library="pytorch",
trained_dataset="imagenet"
)
task="image-classification",
library="pytorch",
trained_dataset="imagenet",
)
```

Expand Down
12 changes: 0 additions & 12 deletions docs/source/en/package_reference/hf_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,3 @@ Below are the supported values for [`CommitOperation`]:
## CommitScheduler

[[autodoc]] CommitScheduler

## Search helpers

Some helpers to filter repositories on the Hub are available in the `huggingface_hub` package.

### DatasetFilter

[[autodoc]] DatasetFilter

### ModelFilter

[[autodoc]] ModelFilter
11 changes: 0 additions & 11 deletions docs/source/ko/package_reference/hf_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,3 @@ models = hf_api.list_models()

[[autodoc]] CommitScheduler

## Search helpers[[search-helpers]]

`huggingface_hub` 패키지에는 Hub에서 리포지토리를 필터링하는 데 도움되는 도구들이 포함되어 있습니다.

### DatasetFilter[[huggingface_hub.DatasetFilter]]

[[autodoc]] DatasetFilter

### ModelFilter[[huggingface_hub.ModelFilter]]

[[autodoc]] ModelFilter
10 changes: 1 addition & 9 deletions src/huggingface_hub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from typing import TYPE_CHECKING


__version__ = "0.23.0.dev0"
__version__ = "0.24.0.dev0"

# Alphabetical order of definitions is ensured in tests
# WARNING: any comment added in this dictionary definition will be lost when
Expand Down Expand Up @@ -445,10 +445,6 @@
"logging",
"scan_cache_dir",
],
"utils.endpoint_helpers": [
"DatasetFilter",
"ModelFilter",
],
}


Expand Down Expand Up @@ -928,7 +924,3 @@ def __dir__():
logging, # noqa: F401
scan_cache_dir, # noqa: F401
)
from .utils.endpoint_helpers import (
DatasetFilter, # noqa: F401
ModelFilter, # noqa: F401
)
Loading

0 comments on commit bb38f94

Please sign in to comment.