lewtun HF staff commited on
Commit
fc0cc1d
2 Parent(s): a8e11a7 bd88977

Merge pull request #41 from huggingface/extend-summarization

Browse files
Files changed (1) hide show
  1. utils.py +7 -0
utils.py CHANGED
@@ -80,6 +80,13 @@ def get_compatible_models(task: str, dataset_ids: List[str]) -> List[str]:
80
  A list of model IDs, sorted alphabetically.
81
  """
82
  compatible_models = []
 
 
 
 
 
 
 
83
  # Include models trained on SQuAD datasets, since these can be evaluated on
84
  # other SQuAD-like datasets
85
  if task == "extractive_question_answering":
 
80
  A list of model IDs, sorted alphabetically.
81
  """
82
  compatible_models = []
83
+ # Allow any summarization model to be used for summarization tasks
84
+ if task == "summarization":
85
+ model_filter = ModelFilter(
86
+ task=AUTOTRAIN_TASK_TO_HUB_TASK[task],
87
+ library=["transformers", "pytorch"],
88
+ )
89
+ compatible_models.extend(HfApi().list_models(filter=model_filter))
90
  # Include models trained on SQuAD datasets, since these can be evaluated on
91
  # other SQuAD-like datasets
92
  if task == "extractive_question_answering":