Skip to content

Commit e90efd6

Browse files
committed
add multi-swe-bench mini leaderboard
1 parent 957a911 commit e90efd6

File tree

4 files changed

+146
-25
lines changed

4 files changed

+146
-25
lines changed

css/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/* --accent_color: #1697e2;
1515
--dark_accent_color: #0ea7ff; */
1616
--accent_color: #2050B0;
17-
--dark_accent_color: #2050B0;
17+
--dark_accent_color: #0797e6;
1818
--odd_line_color: #ffffff;
1919
--even_line_color: #f2f2f2;
2020
--iscas_color: #ea5c29;

img/logo-v3.svg

Lines changed: 1 addition & 0 deletions
Loading

src/Home.vue

Lines changed: 112 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
<template>
22
<Header></Header>
33
<section class="main-container">
4+
<div class="content-wrapper" style="margin-top: 1em; display: flex; justify-content: center; align-items: center;">
5+
<button
6+
@click="switchLeaderboard('Full')"
7+
class="outline teaser swebv"
8+
style="flex-direction: row; display: flex; justify-content: center; align-items: center; width: 15em;">
9+
<img
10+
src="../img/logo-v3.svg"
11+
style="height: 1.3em; margin-right: 0.4em; margin-bottom: 0.1em;" />
12+
Multi-SWE-bench&nbsp;
13+
</button>
14+
<button
15+
@click="switchLeaderboard('Lite')"
16+
class="outline teaser swebl"
17+
style="flex-direction: row; display: flex; justify-content: center; align-items: center; width: 15em;">
18+
<img
19+
src="../img/logo-v3.svg"
20+
style="height: 1.3em; margin-right: 0.4em; margin-bottom: 0.1em; background-color: var(--dark_accent_color);" />
21+
Multi-SWE-bench mini&nbsp;
22+
</button>
23+
</div>
424
<div class="content-wrapper">
525
<div class="content-box" v-if="leaderboard">
6-
<h2 class="text-title">Leaderboard</h2>
7-
<ul class="tab">
26+
<h2 class="text-title">{{LeaderboardName}}</h2>
27+
<ul class="tab" v-if="currentMode !== 'Lite'">
828
<li
929
v-for="{ name, data } in leaderboard"
1030
:key="name"
@@ -143,8 +163,28 @@ import Resources from './Resources.vue'
143163
144164
// const { leaderboard, languageData, datasetResults, language, dataset, total } = useLeaderboard()
145165
// const { visual_leaderboard, visual_languageData, visual_datasetResults, visual_language, visual_dataset, visual_total } = useVisualLeaderboard()
146-
const { allLeaderboards, selectedCategory, leaderboard, languageData, datasetResults, language, dataset, total} = useAllLeaderboard()
147-
const GITHUB_URL = 'https://github.com/multi-swe-bench/experiments/tree/main/evaluation'
166+
const { allLeaderboards, selectedCategory, leaderboard, languageData, datasetResults, language, dataset, total, load} = useAllLeaderboard()
167+
let GITHUB_URL = 'https://github.com/multi-swe-bench/experiments/tree/main/evaluation'
168+
let LeaderboardName = 'Leaderboard'
169+
// 模式:默认是 full
170+
const currentMode = ref<'Full' | 'Lite'>('Full')
171+
172+
// 数据源映射
173+
const urls = {
174+
Full: 'https://github.com/multi-swe-bench/experiments/tree/main/evaluation',
175+
Lite: 'https://github.com/multi-swe-bench/experiments/tree/main/evaluation/lite',
176+
}
177+
const leadnames = {
178+
Full: 'Leaderboard',
179+
Lite: 'Leaderboard-mini',
180+
}
181+
async function switchLeaderboard(mode: 'Full' | 'Lite') {
182+
if (mode === currentMode.value) return
183+
currentMode.value = mode
184+
load(mode)
185+
GITHUB_URL = urls[mode]
186+
LeaderboardName = leadnames[mode]
187+
}
148188
console.log({ allLeaderboards, selectedCategory, leaderboard, languageData, datasetResults, language, dataset, total});
149189
import { ref,computed, watch } from 'vue';
150190
@@ -297,5 +337,73 @@ ul.tab li.disabled {
297337
font-weight: bold;
298338
}
299339
340+
button {
341+
cursor: pointer;
342+
outline: none;
343+
344+
&.outline {
345+
font-size: 16pt;
346+
height: 2em;
347+
width: 7em;
348+
position: relative;
349+
background: transparent;
350+
border: 0px;
351+
border-radius: 0.5em;
352+
padding: 0em 0em;
353+
margin: 0.2em 0.5em;
354+
transition: background-color 0.1s linear, color 0.1s linear;
355+
color: var(--accent_color);
356+
background-color: white;
300357
358+
&.multimodal {
359+
color: var(--slate_gray);
360+
}
361+
362+
&.teaser {
363+
border: 1px solid transparent; /* Specify border style */
364+
border-radius: 0.5em;
365+
transition: box-shadow 1s ease, border-color 1s ease;
366+
box-shadow: 0px 4px 10px rgba(0, 123, 255, 0.3);
367+
}
368+
}
369+
370+
&.outline:hover {
371+
color: wheat;
372+
border-color: wheat;
373+
}
374+
375+
&.outline.teaser.swebm {
376+
background-color: var(--slate_gray);
377+
color: white;
378+
}
379+
380+
&.outline.teaser.swebm:hover {
381+
color: var(--slate_gray);
382+
background: radial-gradient(circle at 10% 30%, rgba(255, 99, 71, 1), transparent 40%),
383+
radial-gradient(circle at 30% 70%, rgba(0, 255, 127, 1), transparent 40%),
384+
radial-gradient(circle at 50% 30%, rgba(70, 130, 180, 1), transparent 40%),
385+
radial-gradient(circle at 70% 70%, rgba(255, 165, 0, 1), transparent 40%),
386+
radial-gradient(circle at 80% 30%, rgba(138, 43, 226, 1), transparent 40%);
387+
transform: scale(1.05);
388+
}
389+
390+
&.outline.teaser.swebv {
391+
background-color: #d1a22b;
392+
color: white;
393+
}
394+
395+
&.outline.teaser.swebv:hover {
396+
background: linear-gradient(to right, rgb(209, 162, 43), rgb(209, 162, 43), rgb(209, 162, 43));
397+
transform: scale(1.05);
398+
}
399+
400+
&.outline.teaser.swebl {
401+
background-color: var(--dark_accent_color);
402+
color: white;
403+
}
404+
405+
&.outline.teaser.swebl:hover {
406+
transform: scale(1.05);
407+
}
408+
}
301409
</style>

src/utils.ts

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function useVisualLeaderboard() {
102102
return { visual_leaderboard, visual_language, visual_dataset, visual_model, visual_languageData, visual_datasetData, visual_datasetResults, visual_modelData, visual_total }
103103
}
104104

105-
export function useAllLeaderboard() {
105+
export function useAllLeaderboard(mode: 'Full' | 'Lite' = 'Full') {
106106
// 新增变量
107107
const allLeaderboards = ref<any[]>()
108108
const allModelResults = ref([]);
@@ -211,26 +211,37 @@ export function useAllLeaderboard() {
211211
})
212212

213213
// 数据加载
214-
onMounted(async () => {
215-
const response = await fetch('https://raw.githubusercontent.com/multi-swe-bench/experiments/refs/heads/dist/leaderboard.json')
216-
allLeaderboards.value = await response.json()
217-
aggregateModelResults(allLeaderboards,allModelResults);
218-
allModelResults.value.sort((a, b) => b.resolved - a.resolved);
219-
const newLanguage = {
220-
name: 'All',
221-
data: [
222-
{
223-
results: allModelResults // 将模型统计结果插入
224-
}
225-
]
226-
};
227-
if(allLeaderboards.value){
228-
allLeaderboards.value.unshift(newLanguage);
229-
console.log(allLeaderboards)
230-
}
231-
console.log(allLeaderboards.value)
214+
onMounted(() => {
215+
load(mode)
232216
})
233217

218+
async function load(mode: 'Full' | 'Lite' = 'Full') {
219+
const url = mode === 'Lite'
220+
? 'https://raw.githubusercontent.com/multi-swe-bench/experiments/refs/heads/dist/leaderboard-lite.json'
221+
: 'https://raw.githubusercontent.com/multi-swe-bench/experiments/refs/heads/dist/leaderboard.json'
222+
223+
const response = await fetch(url)
224+
allLeaderboards.value = await response.json()
225+
226+
aggregateModelResults(allLeaderboards, allModelResults)
227+
allModelResults.value.sort((a, b) => b.resolved - a.resolved)
228+
229+
const newLanguage = {
230+
name: 'All',
231+
data: [
232+
{
233+
results: allModelResults,
234+
},
235+
],
236+
}
237+
238+
if (allLeaderboards.value) {
239+
if(mode == 'Full'){
240+
allLeaderboards.value.unshift(newLanguage)
241+
}
242+
console.log('Reloaded allLeaderboards:', allLeaderboards.value)
243+
}
244+
}
234245
// 返回所有需要的变量和方法
235246
return {
236247
allLeaderboards,
@@ -243,7 +254,8 @@ export function useAllLeaderboard() {
243254
datasetData,
244255
datasetResults,
245256
modelData,
246-
total
257+
total,
258+
load
247259
}
248260
}
249261

0 commit comments

Comments
 (0)