Skip to content

Commit

Permalink
Don't use deprecated DatasetFilter + update deps (#527)
Browse files Browse the repository at this point in the history
* Don't use deprecated DatasetFilter + update deps

* remove support for Python3.7

* code quality

---------

Co-authored-by: Tom Aarsen <[email protected]>
  • Loading branch information
Wauplin and tomaarsen authored Sep 12, 2024
1 parent e78bfa1 commit 6167a03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"datasets>=2.3.0",
"sentence-transformers>=2.2.1",
"evaluate>=0.3.0",
"huggingface_hub>=0.22.1",
"huggingface_hub>=0.21.0",
"scikit-learn",
"packaging",
]
Expand Down
4 changes: 2 additions & 2 deletions src/setfit/model_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import torch
import transformers
from datasets import Dataset
from huggingface_hub import CardData, DatasetFilter, ModelCard, dataset_info, list_datasets, model_info
from huggingface_hub import CardData, ModelCard, dataset_info, list_datasets, model_info
from huggingface_hub.repocard_data import EvalResult, eval_results_to_model_index
from huggingface_hub.utils import yaml_dump
from sentence_transformers import __version__ as sentence_transformers_version
Expand Down Expand Up @@ -409,7 +409,7 @@ def normalize(dataset_id: str) -> str:
# Make sure the normalized dataset IDs match
dataset_list = [
dataset
for dataset in list_datasets(filter=DatasetFilter(author=author, dataset_name=dataset_name))
for dataset in list_datasets(author=author, dataset_name=dataset_name)
if normalize(dataset.id) == normalize(cache_dataset_name)
]
# If there's only one match, get the ID from it
Expand Down

0 comments on commit 6167a03

Please sign in to comment.