lewtun HF staff commited on
Commit
d0649fc
β€’
1 Parent(s): 68b516e

Fix dataset card URLs

Browse files
Files changed (2) hide show
  1. app.py +3 -2
  2. utils.py +8 -0
app.py CHANGED
@@ -15,6 +15,7 @@ from utils import (
15
  commit_evaluation_log,
16
  format_col_mapping,
17
  get_compatible_models,
 
18
  get_key,
19
  get_metadata,
20
  http_get,
@@ -510,6 +511,7 @@ with st.form(key="form"):
510
  ]
511
  }
512
  selected_metadata = yaml.dump(train_eval_index, sort_keys=False)
 
513
  st.success("βœ… Successfully submitted evaluation job!")
514
  st.markdown(
515
  f"""
@@ -522,8 +524,7 @@ with st.form(key="form"):
522
  * πŸ“Š Click [here](https://hf.co/spaces/autoevaluate/leaderboards?dataset={selected_dataset}) \
523
  to view the results from your submission once the Hub pull request is merged.
524
  * πŸ₯± Tired of configuring evaluations? Add the following metadata to the \
525
- [dataset card](https://huggingface.co/datasets/{selected_dataset}/blob/main/README.md) \
526
- to enable 1-click evaluations:
527
  """
528
  )
529
  st.markdown(
 
15
  commit_evaluation_log,
16
  format_col_mapping,
17
  get_compatible_models,
18
+ get_dataset_card_url,
19
  get_key,
20
  get_metadata,
21
  http_get,
 
511
  ]
512
  }
513
  selected_metadata = yaml.dump(train_eval_index, sort_keys=False)
514
+ dataset_card_url = get_dataset_card_url(selected_dataset)
515
  st.success("βœ… Successfully submitted evaluation job!")
516
  st.markdown(
517
  f"""
 
524
  * πŸ“Š Click [here](https://hf.co/spaces/autoevaluate/leaderboards?dataset={selected_dataset}) \
525
  to view the results from your submission once the Hub pull request is merged.
526
  * πŸ₯± Tired of configuring evaluations? Add the following metadata to the \
527
+ [dataset card]({dataset_card_url}) to enable 1-click evaluations:
 
528
  """
529
  )
530
  st.markdown(
utils.py CHANGED
@@ -172,3 +172,11 @@ def get_supported_metrics():
172
  if defaults:
173
  supported_metrics.append(metric)
174
  return supported_metrics
 
 
 
 
 
 
 
 
 
172
  if defaults:
173
  supported_metrics.append(metric)
174
  return supported_metrics
175
+
176
+
177
+ def get_dataset_card_url(dataset_id: str) -> str:
178
+ """Gets the URL to edit the dataset card for the given dataset ID."""
179
+ if "/" in dataset_id:
180
+ return f"https://huggingface.co/datasets/{dataset_id}/edit/main/README.md"
181
+ else:
182
+ return f"https://github.com/huggingface/datasets/edit/master/datasets/{dataset_id}/README.md"