Prevent crash if model-index metadata not specified in model card

#59
by tomaarsen HF staff - opened
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -882,6 +882,8 @@ def get_mteb_data(tasks=["Clustering"], langs=[], datasets=[], fillna=True, add_
882
  print("MODEL", model)
883
  readme_path = hf_hub_download(model.modelId, filename="README.md")
884
  meta = metadata_load(readme_path)
 
 
885
  # meta['model-index'][0]["results"] is list of elements like:
886
  # {
887
  # "task": {"type": "Classification"},
 
882
  print("MODEL", model)
883
  readme_path = hf_hub_download(model.modelId, filename="README.md")
884
  meta = metadata_load(readme_path)
885
+ if "model-index" not in meta:
886
+ continue
887
  # meta['model-index'][0]["results"] is list of elements like:
888
  # {
889
  # "task": {"type": "Classification"},