Skip to content

Commit d3fc983

Browse files
flowerpoetryLoverwshyao
andauthored
show dataset in evaluation detail page (#1234)
Co-authored-by: wshyao <[email protected]>
1 parent f8fe2fe commit d3fc983

File tree

5 files changed

+68
-6
lines changed

5 files changed

+68
-6
lines changed

frontend/src/components/evaluations/EvaluationDetail.vue

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
class="flex items-center gap-4"
8686
v-if="category.datasets.length"
8787
>
88-
<div
88+
<div v-if="!isCustomDataset"
8989
class="border border-gray-300 rounded-sm flex items-center gap-1 px-[6px] py-[2px]"
9090
>
9191
<SvgIcon name="dot_black" />
@@ -96,7 +96,24 @@
9696
v-for="(dataset, index) in category.datasets"
9797
:key="dataset"
9898
>
99-
<div class="text-gray-700 text-base">{{ dataset }}</div>
99+
<span :class="dataset.url ? 'dataset-item-valid' : 'dataset-item-invalid'">
100+
<el-tooltip
101+
:disabled="dataset.url"
102+
class="datasetTooltip"
103+
effect="dark"
104+
:content="$t('evaluation.detail.invalidDataset')"
105+
placement="top"
106+
>
107+
<a
108+
class="text-md font-normal leading-normal"
109+
:href="dataset.url"
110+
:target="dataset.url ? '_blank' : ''"
111+
:class="dataset.url ? 'text-gray-700' : 'text-gray-400 cursor-not-allowed'"
112+
>
113+
{{ dataset.repoDatasetName }}
114+
</a>
115+
</el-tooltip>
116+
</span>
100117
<SvgIcon
101118
v-if="index < category.datasets.length - 1"
102119
name="vertical_divider"
@@ -227,17 +244,40 @@
227244
const error = ref('')
228245
const categories = ref([])
229246
const evaluationSucceed = ref(true)
247+
const isCustomDataset = ref(false)
230248
231249
const groupedDatasets = computed(() => {
250+
if(isCustomDataset.value) {
251+
return [{
252+
name: 'Custom',
253+
datasets: evaluation.value.datasets.map((d) =>
254+
{
255+
return showDataset(d)
256+
})
257+
}]
258+
}
259+
else {
232260
return categories.value.map((category) => ({
233261
name: locale.value === 'en' ? category.name : category.show_name,
234262
datasets:
235263
evaluation.value.datasets
236264
?.filter((d) => d.tags && Array.isArray(d.tags) && d.tags.some((t) => t.name === category.name))
237-
.map((d) => d.repo_id.split('/')[1]) || []
265+
.map((d) =>
266+
{
267+
return showDataset(d)
268+
}
269+
) || []
238270
}))
271+
}
239272
})
240273
274+
const showDataset = (d) => {
275+
return {
276+
repoDatasetName: d.repo_id.split('/')[1] || [],
277+
url: d.deleted ? null : `/datasets/${d.repo_id}?tab=summary`
278+
}
279+
}
280+
241281
const datasets = computed(() => {
242282
if (!evaluationResult.value) return []
243283
return Object.keys(evaluationResult.value).filter(
@@ -419,6 +459,10 @@
419459
420460
evaluation.value = data.value.data
421461
462+
if(evaluation.value.datasets && evaluation.value.datasets.length > 0 && !evaluation.value.datasets[0].tags) {
463+
isCustomDataset.value = true
464+
}
465+
422466
if (evaluation.value.result_url) {
423467
const result = await fetch(evaluation.value.result_url)
424468
evaluationResult.value = await result.json()
@@ -543,4 +587,14 @@
543587
.evaluation-table-row-cell:nth-last-child(1) {
544588
border-bottom-right-radius: 12px;
545589
}
590+
591+
.dataset-item-invalid :deep(.el-tooltip__trigger:hover) {
592+
color: #98A2B3 !important;
593+
background-color: transparent !important;
594+
}
595+
596+
.dataset-item-valid :deep(.el-tooltip__trigger:hover) {
597+
color: #223B99 !important;
598+
background-color: transparent !important;
599+
}
546600
</style>

frontend/src/components/evaluations/NewEvaluation.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
"
169169
size="large"
170170
multiple
171+
class="ignore-height-select"
171172
>
172173
<el-option
173174
v-for="item in models"
@@ -803,6 +804,10 @@
803804
height: auto !important;
804805
}
805806
807+
:deep(.ignore-height-select.el-select) {
808+
height: auto !important;
809+
}
810+
806811
:deep(.el-input .el-input__wrapper) {
807812
border-radius: var(--border-radius-md);
808813
}

frontend/src/locales/en_js/evaluation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export const evaluation = {
4444
download: "Download Results",
4545
evaluationFailed: "Evaluation Failed",
4646
return: "Return",
47-
recreate: "Recreate"
47+
recreate: "Recreate",
48+
invalidDataset: "The dataset has been deleted or is invalid"
4849
},
4950
list: {
5051
title: "Model Evaluation",

frontend/src/locales/zh_hant_js/evaluation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export const evaluation = {
4444
download: "下載評測結果",
4545
evaluationFailed: "評測失敗",
4646
return: "返回",
47-
recreate: "重新創建"
47+
recreate: "重新創建",
48+
invalidDataset: "數據集已刪除或失效"
4849
},
4950
list: {
5051
title: "模型評測",

frontend/src/locales/zh_js/evaluation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export const evaluation = {
4444
download: "下载评测结果",
4545
evaluationFailed: "评测失败",
4646
return: "返回",
47-
recreate: "重新创建"
47+
recreate: "重新创建",
48+
invalidDataset: "数据集已删除或失效"
4849
},
4950
list: {
5051
title: "模型评测",

0 commit comments

Comments
 (0)