Spaces:
Running
Running
Update index.html
Browse files- index.html +278 -105
index.html
CHANGED
|
@@ -3,96 +3,184 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title
|
|
|
|
| 7 |
<style>
|
|
|
|
| 8 |
body {
|
| 9 |
-
font-family:
|
| 10 |
-
background-color: #
|
| 11 |
-
color: #
|
| 12 |
margin: 0;
|
| 13 |
padding: 20px;
|
|
|
|
|
|
|
| 14 |
}
|
|
|
|
|
|
|
| 15 |
h1 {
|
| 16 |
text-align: center;
|
| 17 |
-
color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
}
|
|
|
|
|
|
|
| 19 |
.table-container {
|
| 20 |
overflow-x: auto;
|
| 21 |
margin-top: 20px;
|
| 22 |
position: relative;
|
|
|
|
|
|
|
| 23 |
}
|
|
|
|
|
|
|
| 24 |
table {
|
| 25 |
width: 100%;
|
| 26 |
border-collapse: collapse;
|
| 27 |
margin: 0 auto;
|
| 28 |
-
background-color: #
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
| 31 |
}
|
|
|
|
|
|
|
| 32 |
th, td {
|
| 33 |
-
padding:
|
| 34 |
text-align: left;
|
| 35 |
-
border: 1px solid #
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
position: relative;
|
| 40 |
}
|
|
|
|
|
|
|
| 41 |
th {
|
| 42 |
-
background-color: #
|
| 43 |
-
color: #
|
| 44 |
-
font-weight:
|
| 45 |
-
}
|
| 46 |
-
th.resizable {
|
| 47 |
position: relative;
|
|
|
|
|
|
|
| 48 |
}
|
|
|
|
|
|
|
| 49 |
th.resizable .resizer {
|
| 50 |
position: absolute;
|
| 51 |
top: 0;
|
| 52 |
right: 0;
|
| 53 |
-
width:
|
| 54 |
height: 100%;
|
| 55 |
cursor: col-resize;
|
| 56 |
-
background-color:
|
|
|
|
| 57 |
}
|
| 58 |
-
|
| 59 |
-
|
|
|
|
| 60 |
}
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
.filter {
|
| 65 |
-
margin-bottom:
|
| 66 |
text-align: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
}
|
| 68 |
.filter label {
|
| 69 |
-
font-size:
|
| 70 |
-
margin-right:
|
| 71 |
-
color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
}
|
| 73 |
-
.filter select {
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
border: 1px solid #ccc;
|
| 77 |
-
border-radius: 5px;
|
| 78 |
}
|
| 79 |
-
.
|
| 80 |
-
|
| 81 |
-
|
| 82 |
}
|
|
|
|
|
|
|
| 83 |
.modal {
|
| 84 |
position: fixed;
|
| 85 |
top: 50%;
|
| 86 |
left: 50%;
|
| 87 |
transform: translate(-50%, -50%);
|
| 88 |
-
background-color: #
|
| 89 |
-
box-shadow: 0
|
| 90 |
-
padding:
|
| 91 |
z-index: 1000;
|
| 92 |
-
border-radius:
|
| 93 |
-
max-width:
|
| 94 |
-
max-height:
|
| 95 |
overflow: auto;
|
|
|
|
|
|
|
|
|
|
| 96 |
}
|
| 97 |
.overlay {
|
| 98 |
position: fixed;
|
|
@@ -100,22 +188,31 @@
|
|
| 100 |
left: 0;
|
| 101 |
width: 100%;
|
| 102 |
height: 100%;
|
| 103 |
-
background: rgba(0, 0, 0, 0.
|
| 104 |
z-index: 999;
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
}
|
| 107 |
</style>
|
| 108 |
</head>
|
| 109 |
<body>
|
| 110 |
-
<h1>LLM Benchmark
|
| 111 |
<div>As the development and evaluation of large language models (LLMs) continue to evolve, I conducted an overview of the principal benchmarks commonly found in research papers. My goal is to create a clear and comprehensive resource that summarizes what is being tested in LLMs, with concrete examples, key metrics, and direct links to related papers and repositories. This document serves as a centralized matrix that will be continuously updated with insights from future papers I review.</div>
|
| 112 |
<div class="filter">
|
| 113 |
<label for="metricFilter">Filter by Evaluated task:</label>
|
| 114 |
<select id="metricFilter">
|
| 115 |
<option value="">All</option>
|
| 116 |
</select>
|
| 117 |
-
<
|
| 118 |
-
<input type="text" id="searchInput" placeholder="Search for benchmark names ..." style="margin-bottom: 10px; padding: 8px; width: 100%;">
|
| 119 |
</div>
|
| 120 |
<div class="table-container">
|
| 121 |
<table id="csvTable">
|
|
@@ -132,6 +229,7 @@
|
|
| 132 |
<div class="modal" id="modal" style="display: none;"></div>
|
| 133 |
|
| 134 |
<script>
|
|
|
|
| 135 |
function parseCSV(content) {
|
| 136 |
const rows = [];
|
| 137 |
let currentRow = [];
|
|
@@ -153,85 +251,131 @@
|
|
| 153 |
currentField += char;
|
| 154 |
}
|
| 155 |
}
|
|
|
|
| 156 |
if (currentField) currentRow.push(currentField.trim());
|
| 157 |
if (currentRow.length > 0) rows.push(currentRow);
|
| 158 |
-
|
|
|
|
| 159 |
return { headers, rows };
|
| 160 |
}
|
|
|
|
|
|
|
| 161 |
async function loadCSVFromHuggingFace(dataset, filename, token) {
|
| 162 |
-
const url =
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
}
|
| 173 |
-
|
| 174 |
-
const content = await response.text();
|
| 175 |
-
|
| 176 |
-
return parseCSV(content);
|
| 177 |
}
|
|
|
|
| 178 |
const metricFilter = document.getElementById('metricFilter');
|
| 179 |
const table = document.getElementById('csvTable');
|
| 180 |
const tableHead = table.querySelector('thead');
|
| 181 |
const tableBody = table.querySelector('tbody');
|
| 182 |
const overlay = document.getElementById('overlay');
|
| 183 |
const modal = document.getElementById('modal');
|
|
|
|
| 184 |
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
const
|
| 188 |
const rows = table.querySelectorAll('tbody tr');
|
| 189 |
-
|
| 190 |
rows.forEach(row => {
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
});
|
| 197 |
-
|
| 198 |
-
|
|
|
|
| 199 |
function makeResizable() {
|
| 200 |
const thElements = document.querySelectorAll('th');
|
| 201 |
thElements.forEach(th => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
const resizer = document.createElement('div');
|
| 203 |
resizer.classList.add('resizer');
|
| 204 |
th.appendChild(resizer);
|
|
|
|
| 205 |
let startX;
|
| 206 |
let startWidth;
|
| 207 |
-
|
| 208 |
-
|
|
|
|
| 209 |
startWidth = th.offsetWidth;
|
| 210 |
document.addEventListener('mousemove', resizeColumn);
|
| 211 |
document.addEventListener('mouseup', stopResize);
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
th.style.width = `${newWidth}px`;
|
| 216 |
-
|
| 217 |
-
|
|
|
|
|
|
|
|
|
|
| 218 |
document.removeEventListener('mousemove', resizeColumn);
|
| 219 |
document.removeEventListener('mouseup', stopResize);
|
| 220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
});
|
| 222 |
}
|
|
|
|
|
|
|
| 223 |
function populateFilterOptions(data, headerIndex) {
|
| 224 |
-
const uniqueMetricTypes = [...new Set(data.map(row => row[headerIndex]))];
|
|
|
|
| 225 |
uniqueMetricTypes.forEach(type => {
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
|
|
|
|
|
|
| 230 |
});
|
| 231 |
}
|
|
|
|
|
|
|
| 232 |
function populateTable(headers, rows, filterValue, headerIndex) {
|
| 233 |
tableHead.innerHTML = '';
|
| 234 |
tableBody.innerHTML = '';
|
|
|
|
| 235 |
const headerRow = document.createElement('tr');
|
| 236 |
headers.forEach(header => {
|
| 237 |
const th = document.createElement('th');
|
|
@@ -240,56 +384,85 @@
|
|
| 240 |
headerRow.appendChild(th);
|
| 241 |
});
|
| 242 |
tableHead.appendChild(headerRow);
|
|
|
|
|
|
|
|
|
|
| 243 |
rows
|
| 244 |
-
.filter(row =>
|
| 245 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 246 |
.forEach(row => {
|
| 247 |
const tr = document.createElement('tr');
|
|
|
|
|
|
|
| 248 |
row.forEach((value, index) => {
|
| 249 |
const td = document.createElement('td');
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
if (headers[index] === 'Paper' && value) {
|
| 251 |
const link = document.createElement('a');
|
| 252 |
link.href = value;
|
| 253 |
-
link.textContent = '
|
| 254 |
link.target = '_blank';
|
| 255 |
-
|
| 256 |
} else if (headers[index] === 'HF or Git link' && value) {
|
| 257 |
const link = document.createElement('a');
|
| 258 |
link.href = value;
|
| 259 |
-
link.textContent = '
|
| 260 |
link.target = '_blank';
|
| 261 |
-
|
| 262 |
} else {
|
| 263 |
-
|
| 264 |
}
|
| 265 |
-
|
|
|
|
|
|
|
|
|
|
| 266 |
td.title = 'Click to expand';
|
| 267 |
td.addEventListener('click', () => {
|
| 268 |
overlay.style.display = 'block';
|
| 269 |
modal.style.display = 'block';
|
| 270 |
-
modal.textContent = value;
|
| 271 |
-
modal.style.whiteSpace = 'pre-wrap';
|
| 272 |
});
|
| 273 |
tr.appendChild(td);
|
| 274 |
});
|
| 275 |
tableBody.appendChild(tr);
|
| 276 |
});
|
| 277 |
-
makeResizable();
|
| 278 |
}
|
|
|
|
|
|
|
| 279 |
overlay.addEventListener('click', () => {
|
| 280 |
overlay.style.display = 'none';
|
| 281 |
modal.style.display = 'none';
|
| 282 |
});
|
|
|
|
|
|
|
| 283 |
metricFilter.addEventListener('change', () => {
|
| 284 |
const filterValue = metricFilter.value;
|
| 285 |
-
populateTable(parsedCSV.headers, parsedCSV.rows, filterValue, 0);
|
| 286 |
});
|
|
|
|
| 287 |
let parsedCSV;
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
</script>
|
| 294 |
</body>
|
| 295 |
-
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>LLM Benchmark Overview</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap" rel="stylesheet">
|
| 8 |
<style>
|
| 9 |
+
|
| 10 |
body {
|
| 11 |
+
font-family: 'Inter', sans-serif;
|
| 12 |
+
background-color: #1a1a2e;
|
| 13 |
+
color: #e0e0e0;
|
| 14 |
margin: 0;
|
| 15 |
padding: 20px;
|
| 16 |
+
line-height: 1.6;
|
| 17 |
+
font-size: 14px;
|
| 18 |
}
|
| 19 |
+
|
| 20 |
+
|
| 21 |
h1 {
|
| 22 |
text-align: center;
|
| 23 |
+
color: #a766ff;
|
| 24 |
+
margin-bottom: 30px;
|
| 25 |
+
font-weight: 600;
|
| 26 |
+
font-size: 2.2em;
|
| 27 |
+
text-shadow: 0 0 10px rgba(167, 102, 255, 0.4);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
body > div:nth-of-type(1) {
|
| 32 |
+
max-width: 900px;
|
| 33 |
+
margin: 0 auto 30px auto;
|
| 34 |
+
text-align: justify;
|
| 35 |
+
background-color: #2a2a4a;
|
| 36 |
+
padding: 20px;
|
| 37 |
+
border-radius: 12px;
|
| 38 |
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
|
| 39 |
+
font-size: 0.95em;
|
| 40 |
}
|
| 41 |
+
|
| 42 |
+
|
| 43 |
.table-container {
|
| 44 |
overflow-x: auto;
|
| 45 |
margin-top: 20px;
|
| 46 |
position: relative;
|
| 47 |
+
border-radius: 12px;
|
| 48 |
+
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
|
| 49 |
}
|
| 50 |
+
|
| 51 |
+
|
| 52 |
table {
|
| 53 |
width: 100%;
|
| 54 |
border-collapse: collapse;
|
| 55 |
margin: 0 auto;
|
| 56 |
+
background-color: #2a2a4a;
|
| 57 |
+
border-radius: 12px;
|
| 58 |
+
overflow: hidden;
|
| 59 |
+
min-width: 900px;
|
| 60 |
+
table-layout: fixed;
|
| 61 |
}
|
| 62 |
+
|
| 63 |
+
|
| 64 |
th, td {
|
| 65 |
+
padding: 12px 15px;
|
| 66 |
text-align: left;
|
| 67 |
+
border: 1px solid #3a3a5a;
|
| 68 |
+
font-size: 0.9em;
|
| 69 |
+
vertical-align: top;
|
| 70 |
+
|
|
|
|
| 71 |
}
|
| 72 |
+
|
| 73 |
+
|
| 74 |
th {
|
| 75 |
+
background-color: #3a3a5a;
|
| 76 |
+
color: #c0c0c0;
|
| 77 |
+
font-weight: 600;
|
|
|
|
|
|
|
| 78 |
position: relative;
|
| 79 |
+
white-space: normal;
|
| 80 |
+
word-wrap: break-word;
|
| 81 |
}
|
| 82 |
+
|
| 83 |
+
|
| 84 |
th.resizable .resizer {
|
| 85 |
position: absolute;
|
| 86 |
top: 0;
|
| 87 |
right: 0;
|
| 88 |
+
width: 8px;
|
| 89 |
height: 100%;
|
| 90 |
cursor: col-resize;
|
| 91 |
+
background-color: rgba(167, 102, 255, 0.2);
|
| 92 |
+
transition: background-color 0.2s ease-in-out;
|
| 93 |
}
|
| 94 |
+
|
| 95 |
+
th.resizable .resizer:hover {
|
| 96 |
+
background-color: rgba(167, 102, 255, 0.5);
|
| 97 |
}
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
tr:nth-child(even) {
|
| 101 |
+
background-color: #2f2f50;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
|
| 106 |
+
th:nth-child(1), td:nth-child(1) { width: 15%; min-width: 120px; }
|
| 107 |
+
th:nth-child(2), td:nth-child(2) { width: 15%; min-width: 120px; }
|
| 108 |
+
th:nth-child(3), td:nth-child(3) { width: 20%; min-width: 150px; }
|
| 109 |
+
th:nth-child(4), td:nth-child(4) { width: 25%; min-width: 200px; }
|
| 110 |
+
th:nth-child(5), td:nth-child(5) { width: 25%; min-width: 200px; }
|
| 111 |
+
th:nth-child(6), td:nth-child(6) { width: 10%; min-width: 80px; }
|
| 112 |
+
th:nth-child(7), td:nth-child(7) { width: 10%; min-width: 80px; }
|
| 113 |
+
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
.cell-content {
|
| 117 |
+
cursor: pointer;
|
| 118 |
+
overflow: hidden;
|
| 119 |
+
text-overflow: ellipsis;
|
| 120 |
+
display: -webkit-box;
|
| 121 |
+
-webkit-line-clamp: 4;
|
| 122 |
+
-webkit-box-orient: vertical;
|
| 123 |
+
white-space: normal;
|
| 124 |
+
word-wrap: break-word;
|
| 125 |
}
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
td:hover {
|
| 129 |
+
background-color: #3a3a5a;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
|
| 133 |
.filter {
|
| 134 |
+
margin-bottom: 25px;
|
| 135 |
text-align: center;
|
| 136 |
+
display: flex;
|
| 137 |
+
flex-wrap: wrap;
|
| 138 |
+
justify-content: center;
|
| 139 |
+
align-items: center;
|
| 140 |
+
gap: 15px;
|
| 141 |
}
|
| 142 |
.filter label {
|
| 143 |
+
font-size: 1em;
|
| 144 |
+
margin-right: 5px;
|
| 145 |
+
color: #a766ff;
|
| 146 |
+
font-weight: 600;
|
| 147 |
+
}
|
| 148 |
+
.filter select, .filter input[type="text"] {
|
| 149 |
+
padding: 8px 12px;
|
| 150 |
+
font-size: 0.95em;
|
| 151 |
+
border: 1px solid #5a5a7a;
|
| 152 |
+
border-radius: 8px;
|
| 153 |
+
background-color: #3a3a5a;
|
| 154 |
+
color: #e0e0e0;
|
| 155 |
+
outline: none;
|
| 156 |
+
transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
|
| 157 |
}
|
| 158 |
+
.filter select:focus, .filter input[type="text"]:focus {
|
| 159 |
+
border-color: #a766ff;
|
| 160 |
+
box-shadow: 0 0 8px rgba(167, 102, 255, 0.5);
|
|
|
|
|
|
|
| 161 |
}
|
| 162 |
+
.filter input[type="text"] {
|
| 163 |
+
flex-grow: 1;
|
| 164 |
+
max-width: 400px;
|
| 165 |
}
|
| 166 |
+
|
| 167 |
+
|
| 168 |
.modal {
|
| 169 |
position: fixed;
|
| 170 |
top: 50%;
|
| 171 |
left: 50%;
|
| 172 |
transform: translate(-50%, -50%);
|
| 173 |
+
background-color: #2a2a4a;
|
| 174 |
+
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
|
| 175 |
+
padding: 30px;
|
| 176 |
z-index: 1000;
|
| 177 |
+
border-radius: 12px;
|
| 178 |
+
max-width: 90%;
|
| 179 |
+
max-height: 90%;
|
| 180 |
overflow: auto;
|
| 181 |
+
color: #e0e0e0;
|
| 182 |
+
font-size: 1em;
|
| 183 |
+
white-space: pre-wrap;
|
| 184 |
}
|
| 185 |
.overlay {
|
| 186 |
position: fixed;
|
|
|
|
| 188 |
left: 0;
|
| 189 |
width: 100%;
|
| 190 |
height: 100%;
|
| 191 |
+
background: rgba(0, 0, 0, 0.8);
|
| 192 |
z-index: 999;
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
|
| 196 |
+
a {
|
| 197 |
+
color: #a766ff;
|
| 198 |
+
text-decoration: none;
|
| 199 |
+
transition: color 0.2s ease-in-out;
|
| 200 |
+
}
|
| 201 |
+
a:hover {
|
| 202 |
+
color: #c08cff;
|
| 203 |
+
text-decoration: underline;
|
| 204 |
}
|
| 205 |
</style>
|
| 206 |
</head>
|
| 207 |
<body>
|
| 208 |
+
<h1>LLM Benchmark Overview</h1>
|
| 209 |
<div>As the development and evaluation of large language models (LLMs) continue to evolve, I conducted an overview of the principal benchmarks commonly found in research papers. My goal is to create a clear and comprehensive resource that summarizes what is being tested in LLMs, with concrete examples, key metrics, and direct links to related papers and repositories. This document serves as a centralized matrix that will be continuously updated with insights from future papers I review.</div>
|
| 210 |
<div class="filter">
|
| 211 |
<label for="metricFilter">Filter by Evaluated task:</label>
|
| 212 |
<select id="metricFilter">
|
| 213 |
<option value="">All</option>
|
| 214 |
</select>
|
| 215 |
+
<input type="text" id="searchInput" placeholder="Search for benchmark names..." style="margin-bottom: 0;">
|
|
|
|
| 216 |
</div>
|
| 217 |
<div class="table-container">
|
| 218 |
<table id="csvTable">
|
|
|
|
| 229 |
<div class="modal" id="modal" style="display: none;"></div>
|
| 230 |
|
| 231 |
<script>
|
| 232 |
+
// Custom CSV parser to handle quoted fields with commas/newlines
|
| 233 |
function parseCSV(content) {
|
| 234 |
const rows = [];
|
| 235 |
let currentRow = [];
|
|
|
|
| 251 |
currentField += char;
|
| 252 |
}
|
| 253 |
}
|
| 254 |
+
// Add the last field and row if any
|
| 255 |
if (currentField) currentRow.push(currentField.trim());
|
| 256 |
if (currentRow.length > 0) rows.push(currentRow);
|
| 257 |
+
|
| 258 |
+
const headers = rows.shift(); // First row is headers
|
| 259 |
return { headers, rows };
|
| 260 |
}
|
| 261 |
+
|
| 262 |
+
// Function to load CSV from Hugging Face (commented out for Canvas preview)
|
| 263 |
async function loadCSVFromHuggingFace(dataset, filename, token) {
|
| 264 |
+
const url = `https://huggingface.co/datasets/${dataset}/resolve/main/${filename}`;
|
| 265 |
+
try {
|
| 266 |
+
const response = await fetch(url, {
|
| 267 |
+
headers: {
|
| 268 |
+
// 'Authorization': `Bearer ${token}`, // Uncomment if a token is required
|
| 269 |
+
},
|
| 270 |
+
});
|
| 271 |
+
|
| 272 |
+
if (!response.ok) {
|
| 273 |
+
throw new Error(`Failed to fetch file: ${response.statusText}`);
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
const content = await response.text();
|
| 277 |
+
return parseCSV(content);
|
| 278 |
+
} catch (error) {
|
| 279 |
+
console.error("Error loading CSV from Hugging Face:", error);
|
| 280 |
+
// Fallback or error message to user could go here
|
| 281 |
+
return { headers: [], rows: [] };
|
| 282 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
}
|
| 284 |
+
|
| 285 |
const metricFilter = document.getElementById('metricFilter');
|
| 286 |
const table = document.getElementById('csvTable');
|
| 287 |
const tableHead = table.querySelector('thead');
|
| 288 |
const tableBody = table.querySelector('tbody');
|
| 289 |
const overlay = document.getElementById('overlay');
|
| 290 |
const modal = document.getElementById('modal');
|
| 291 |
+
const searchInput = document.getElementById('searchInput');
|
| 292 |
|
| 293 |
+
// Search functionality
|
| 294 |
+
searchInput.addEventListener('input', function () {
|
| 295 |
+
const filterText = this.value.trim().toLowerCase();
|
| 296 |
const rows = table.querySelectorAll('tbody tr');
|
| 297 |
+
|
| 298 |
rows.forEach(row => {
|
| 299 |
+
const benchmarkNameCell = row.cells[1]; // Assuming Benchmark Name is the second column
|
| 300 |
+
if (benchmarkNameCell) {
|
| 301 |
+
const name = benchmarkNameCell.textContent.trim().toLowerCase();
|
| 302 |
+
// Check if the current filter value from the dropdown is also applied
|
| 303 |
+
const currentMetricFilter = metricFilter.value;
|
| 304 |
+
const rowMetricType = row.dataset.metricType; // Get the original metric type
|
| 305 |
+
|
| 306 |
+
const matchesSearch = name.includes(filterText);
|
| 307 |
+
const matchesMetric = !currentMetricFilter || rowMetricType === currentMetricFilter;
|
| 308 |
+
|
| 309 |
+
row.style.display = (matchesSearch && matchesMetric) ? '' : 'none';
|
| 310 |
+
}
|
| 311 |
});
|
| 312 |
+
});
|
| 313 |
+
|
| 314 |
+
// Makes table columns resizable
|
| 315 |
function makeResizable() {
|
| 316 |
const thElements = document.querySelectorAll('th');
|
| 317 |
thElements.forEach(th => {
|
| 318 |
+
// Remove existing resizer to prevent duplicates on re-render
|
| 319 |
+
let existingResizer = th.querySelector('.resizer');
|
| 320 |
+
if (existingResizer) {
|
| 321 |
+
existingResizer.remove();
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
const resizer = document.createElement('div');
|
| 325 |
resizer.classList.add('resizer');
|
| 326 |
th.appendChild(resizer);
|
| 327 |
+
|
| 328 |
let startX;
|
| 329 |
let startWidth;
|
| 330 |
+
|
| 331 |
+
const initResize = (e) => {
|
| 332 |
+
startX = e.type === 'mousedown' ? e.pageX : e.touches[0].pageX;
|
| 333 |
startWidth = th.offsetWidth;
|
| 334 |
document.addEventListener('mousemove', resizeColumn);
|
| 335 |
document.addEventListener('mouseup', stopResize);
|
| 336 |
+
document.addEventListener('touchmove', resizeColumn, { passive: false });
|
| 337 |
+
document.addEventListener('touchend', stopResize);
|
| 338 |
+
};
|
| 339 |
+
|
| 340 |
+
const resizeColumn = (e) => {
|
| 341 |
+
const currentX = e.type === 'mousemove' ? e.pageX : e.touches[0].pageX;
|
| 342 |
+
const newWidth = startWidth + (currentX - startX);
|
| 343 |
th.style.width = `${newWidth}px`;
|
| 344 |
+
// Prevent text selection during resize
|
| 345 |
+
e.preventDefault();
|
| 346 |
+
};
|
| 347 |
+
|
| 348 |
+
const stopResize = () => {
|
| 349 |
document.removeEventListener('mousemove', resizeColumn);
|
| 350 |
document.removeEventListener('mouseup', stopResize);
|
| 351 |
+
document.removeEventListener('touchmove', resizeColumn);
|
| 352 |
+
document.removeEventListener('touchend', stopResize);
|
| 353 |
+
};
|
| 354 |
+
|
| 355 |
+
resizer.addEventListener('mousedown', initResize);
|
| 356 |
+
resizer.addEventListener('touchstart', initResize, { passive: false });
|
| 357 |
});
|
| 358 |
}
|
| 359 |
+
|
| 360 |
+
// Populates the filter dropdown with unique metric types
|
| 361 |
function populateFilterOptions(data, headerIndex) {
|
| 362 |
+
const uniqueMetricTypes = [...new Set(data.map(row => row[headerIndex]))].sort(); // Sort options alphabetically
|
| 363 |
+
metricFilter.innerHTML = '<option value="">All</option>'; // Reset and add "All" option
|
| 364 |
uniqueMetricTypes.forEach(type => {
|
| 365 |
+
if (type) { // Avoid adding empty strings as options
|
| 366 |
+
const option = document.createElement('option');
|
| 367 |
+
option.value = type;
|
| 368 |
+
option.textContent = type;
|
| 369 |
+
metricFilter.appendChild(option);
|
| 370 |
+
}
|
| 371 |
});
|
| 372 |
}
|
| 373 |
+
|
| 374 |
+
// Populates the table with data, applying filters and search
|
| 375 |
function populateTable(headers, rows, filterValue, headerIndex) {
|
| 376 |
tableHead.innerHTML = '';
|
| 377 |
tableBody.innerHTML = '';
|
| 378 |
+
|
| 379 |
const headerRow = document.createElement('tr');
|
| 380 |
headers.forEach(header => {
|
| 381 |
const th = document.createElement('th');
|
|
|
|
| 384 |
headerRow.appendChild(th);
|
| 385 |
});
|
| 386 |
tableHead.appendChild(headerRow);
|
| 387 |
+
|
| 388 |
+
const searchFilterText = searchInput.value.trim().toLowerCase();
|
| 389 |
+
|
| 390 |
rows
|
| 391 |
+
.filter(row => {
|
| 392 |
+
const matchesMetric = !filterValue || row[headerIndex] === filterValue;
|
| 393 |
+
const benchmarkName = row[1] ? row[1].toLowerCase() : ''; // Assuming Benchmark Name is at index 1
|
| 394 |
+
const matchesSearch = benchmarkName.includes(searchFilterText);
|
| 395 |
+
return matchesMetric && matchesSearch;
|
| 396 |
+
})
|
| 397 |
+
.sort((a, b) => a[0].localeCompare(b[0])) // Sort by the first column (Evaluated task)
|
| 398 |
.forEach(row => {
|
| 399 |
const tr = document.createElement('tr');
|
| 400 |
+
tr.dataset.metricType = row[headerIndex]; // Store original metric type for search filtering
|
| 401 |
+
|
| 402 |
row.forEach((value, index) => {
|
| 403 |
const td = document.createElement('td');
|
| 404 |
+
const contentDiv = document.createElement('div'); // Create inner div for content
|
| 405 |
+
contentDiv.classList.add('cell-content'); // Add class for truncation styles
|
| 406 |
+
|
| 407 |
+
// Handle links for 'Paper' and 'HF or Git link' columns
|
| 408 |
if (headers[index] === 'Paper' && value) {
|
| 409 |
const link = document.createElement('a');
|
| 410 |
link.href = value;
|
| 411 |
+
link.textContent = 'Paper Link';
|
| 412 |
link.target = '_blank';
|
| 413 |
+
contentDiv.appendChild(link); // Append link to inner div
|
| 414 |
} else if (headers[index] === 'HF or Git link' && value) {
|
| 415 |
const link = document.createElement('a');
|
| 416 |
link.href = value;
|
| 417 |
+
link.textContent = 'Dataset Link';
|
| 418 |
link.target = '_blank';
|
| 419 |
+
contentDiv.appendChild(link); // Append link to inner div
|
| 420 |
} else {
|
| 421 |
+
contentDiv.textContent = value; // Set text content to inner div
|
| 422 |
}
|
| 423 |
+
|
| 424 |
+
td.appendChild(contentDiv); // Append inner div to td
|
| 425 |
+
|
| 426 |
+
// Add click listener to the td for modal display
|
| 427 |
td.title = 'Click to expand';
|
| 428 |
td.addEventListener('click', () => {
|
| 429 |
overlay.style.display = 'block';
|
| 430 |
modal.style.display = 'block';
|
| 431 |
+
modal.textContent = value; // Display full content in modal
|
|
|
|
| 432 |
});
|
| 433 |
tr.appendChild(td);
|
| 434 |
});
|
| 435 |
tableBody.appendChild(tr);
|
| 436 |
});
|
| 437 |
+
makeResizable(); // Re-apply resizable functionality after table population
|
| 438 |
}
|
| 439 |
+
|
| 440 |
+
// Close modal on overlay click
|
| 441 |
overlay.addEventListener('click', () => {
|
| 442 |
overlay.style.display = 'none';
|
| 443 |
modal.style.display = 'none';
|
| 444 |
});
|
| 445 |
+
|
| 446 |
+
// Filter change listener
|
| 447 |
metricFilter.addEventListener('change', () => {
|
| 448 |
const filterValue = metricFilter.value;
|
| 449 |
+
populateTable(parsedCSV.headers, parsedCSV.rows, filterValue, 0); // Re-populate table with new filter
|
| 450 |
});
|
| 451 |
+
|
| 452 |
let parsedCSV;
|
| 453 |
+
|
| 454 |
+
// --- UNCOMMENT THE FOLLOWING BLOCK TO LOAD LIVE DATA FROM HUGGING FACE ---
|
| 455 |
+
loadCSVFromHuggingFace('UlrickBL/benchmark_overview', 'benchmark_overview.csv', window.huggingface.variables.HF_TOKEN)
|
| 456 |
+
.then(({ headers, rows }) => {
|
| 457 |
+
parsedCSV = { headers, rows };
|
| 458 |
+
populateFilterOptions(rows, 0);
|
| 459 |
+
populateTable(headers, rows, '', 0);
|
| 460 |
+
})
|
| 461 |
+
.catch(error => {
|
| 462 |
+
console.error("Failed to load CSV data:", error);
|
| 463 |
+
// Display a user-friendly message if data loading fails
|
| 464 |
+
tableBody.innerHTML = '<tr><td colspan="7" style="text-align: center; color: #ff6b6b;">Failed to load data. Please check the dataset link or your internet connection.</td></tr>';
|
| 465 |
+
});
|
| 466 |
</script>
|
| 467 |
</body>
|
| 468 |
+
</html>
|