Spaces:
Runtime error
Runtime error
Merge pull request #32 from huggingface/fix-dataset-card-url
Browse files
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](
|
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"
|