Skip to content

Commit

Permalink
Update get_model_card.py (remove deprecated use of ModelFilter)
Browse files Browse the repository at this point in the history
This PR remove deprecated use of `ModelFilter`. Arguments can now be passed to `list_models` directly. See huggingface/huggingface_hub#2028 for more details.
  • Loading branch information
Wauplin authored Aug 13, 2024
1 parent 8f7b28a commit a1097fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions misc/misc/get_model_card.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pandas as pd
from huggingface_hub import ModelFilter, HfApi
from huggingface_hub import HfApi

header = 'https://huggingface.co'

Expand Down Expand Up @@ -71,7 +71,7 @@ def parse(alias):

api = HfApi()

models = sorted([i.modelId for i in api.list_models(filter=ModelFilter(author='lmqg')) if 'tweetqa' not in i.modelId])
models = sorted([model.id for model in api.list_models(author='lmqg') if 'tweetqa' not in model.id])
ablation_models = pd.DataFrame([parse(i) for i in models if 'subjqa' in i or 'squadshifts' in i])
ablation_models.pop("Task")
ablation_models = ablation_models.to_markdown(index=False)
Expand Down

0 comments on commit a1097fd

Please sign in to comment.