-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.tsx
151 lines (132 loc) · 5.8 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import React, { useState, useEffect } from 'react';
import ReactDOM from "react-dom"
import Leaderboard from "./LeaderboardComp"
import "./index.css"
import mockDataGen from "./mocks/performances_generation.json"
import mockDataRep from "./mocks/performances_repair.json"
import mockDataTest from "./mocks/performances_testgen.json"
import mockDataExec from "./mocks/performances_execution.json"
const LeaderboardTabs = () => {
// State to track the currently selected tab
const [activeTab, setActiveTab] = useState('tab1');
const [isMobile, setIsMobile] = useState(window.innerWidth < 768);
useEffect(() => {
const handleResize = () => {
setIsMobile(window.innerWidth < 768);
};
window.addEventListener('resize', handleResize);
return () => {
window.removeEventListener('resize', handleResize);
};
}, []);
// Function to render the leaderboard based on the selected tab
const renderLeaderboard = () => {
// console.log(activeTab);
switch (activeTab) {
case 'tab1':
return <Leaderboard theme={{ base: "light" }} args={mockDataGen} />;
case 'tab2':
return <Leaderboard theme={{ base: "light" }} args={mockDataRep} />;
case 'tab3':
return <Leaderboard theme={{ base: "light" }} args={mockDataTest} />;
case 'tab4':
return <Leaderboard theme={{ base: "light" }} args={mockDataExec} />;
default:
return <div>Select a tab</div>;
}
};
return (
<div className="tabs-container">
<ul className={`tabs ${isMobile ? 'mobile' : ''}`}>
<li className={activeTab === 'tab1' ? 'is-active' : ''} onClick={() => setActiveTab('tab1')}><a>Code Generation</a></li>
<li className={activeTab === 'tab2' ? 'is-active' : ''} onClick={() => setActiveTab('tab2')}><a>Self Repair</a></li>
<li className={activeTab === 'tab3' ? 'is-active' : ''} onClick={() => setActiveTab('tab3')}><a>Test Output Prediction</a></li>
<li className={activeTab === 'tab4' ? 'is-active' : ''} onClick={() => setActiveTab('tab4')}><a>Code Execution</a></li>
</ul>
<div className="tab-content">
{renderLeaderboard()}
</div>
</div>
);
};
ReactDOM.render(
<React.StrictMode>
<section className="hero">
<div className="hero-body">
<div className="container">
<div className="columns is-centered">
<div className="column has-text-centered">
<h1 className="title is-1 publication-title">
LiveCodeBench: Holistic and Contamination Free Evaluation of
Large Language Models for Code
</h1>
<div className="column has-text-centered">
<div className="publication-links">
<span className="link-block">
<a href="https://arxiv.org/abs/2403.07974"
className="external-link button is-normal is-rounded is-dark">
<span className="icon">
<i className="fas fa-file-pdf"></i>
</span>
<span>Paper</span>
</a>
</span>
<span className="link-block">
<a href="https://github.com/LiveCodeBench/LiveCodeBench"
className="external-link button is-normal is-rounded is-dark">
<span className="icon">
<i className="fab fa-github"></i>
</span>
<span>Code</span>
</a>
</span>
<span className="link-block">
<a href="https://huggingface.co/livecodebench/"
className="external-link button is-normal is-rounded is-dark">
<span className="icon">
<i className="far fa-images"></i>
</span>
<span>Data</span>
</a>
</span>
<span className="link-block">
<a
href="https://livecodebench.github.io/"
className="external-link button is-normal is-rounded is-dark"
>
<span className="icon">
<i className="fas fa-home"></i>
</span>
<span>Home</span>
</a>
</span>
</div>
</div>
<div className="column has-text-centered">
<LeaderboardTabs />
</div>
<section className="section">
<div className="container">
<div className="columns is-centered has-text-centered">
<div className="column is-four-fifths">
<h2 className="title is-3">Submitting Custom Models</h2>
<div className="content has-text-justified">
<p>
To submit models to the leaderboard, you can run the evaluation using the evaluation scripts in <a href="https://github.com/LiveCodeBench/LiveCodeBench">GitHub</a>. Once you have the results,
you can fill out <a href="https://forms.gle/h2abvAHh6UnhWzzd9">this form</a>. You will need to fill out
model details and provide the generated evaluation file with model generations and pass@1 scores. We will
review the submission and add the model to the leaderboard accordingly.
</p>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
</section>
</React.StrictMode>,
document.getElementById("root")
)