lewtun HF staff commited on
Commit
bd88977
1 Parent(s): ac54d65

Enable any summarization model to be evaluated on any summarization dataset

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