Update frontend/src/App.js
Browse files- frontend/src/App.js +44 -86
frontend/src/App.js
CHANGED
@@ -1,24 +1,17 @@
|
|
1 |
import React, { useState, useEffect } from 'react';
|
2 |
import _ from 'lodash';
|
|
|
|
|
3 |
const ScoreBar = ({ score }) => {
|
4 |
const percentage = score <= 1 ? score * 100 : score;
|
5 |
-
const hue = Math.min(percentage * 1.2, 120); // 0 = red, 120 = green
|
6 |
-
const backgroundColor = `hsl(${hue}, 70%, 45%)`;
|
7 |
|
8 |
return (
|
9 |
-
<div className="
|
10 |
<div
|
11 |
-
className="
|
12 |
-
style={{
|
13 |
-
width: `${percentage}%`,
|
14 |
-
backgroundColor
|
15 |
-
}}
|
16 |
/>
|
17 |
-
<
|
18 |
-
<span className="text-sm font-medium text-white mix-blend-difference">
|
19 |
-
{percentage.toFixed(2)}%
|
20 |
-
</span>
|
21 |
-
</div>
|
22 |
</div>
|
23 |
);
|
24 |
};
|
@@ -66,87 +59,52 @@ function App() {
|
|
66 |
)
|
67 |
.value();
|
68 |
|
69 |
-
if (loading)
|
70 |
-
|
71 |
-
<div className="flex items-center justify-center min-h-screen">
|
72 |
-
<div className="text-lg">Loading benchmark results...</div>
|
73 |
-
</div>
|
74 |
-
);
|
75 |
-
}
|
76 |
-
|
77 |
-
if (error) {
|
78 |
-
return (
|
79 |
-
<div className="flex items-center justify-center min-h-screen text-red-600">
|
80 |
-
Error: {error}
|
81 |
-
</div>
|
82 |
-
);
|
83 |
-
}
|
84 |
|
85 |
return (
|
86 |
-
<div className="
|
87 |
-
<div className="
|
88 |
-
<h1 className="
|
89 |
-
<p className="
|
90 |
</div>
|
91 |
|
92 |
-
<div className="
|
93 |
-
<
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
onChange={(e) => setSearchQuery(e.target.value)}
|
101 |
-
/>
|
102 |
-
</div>
|
103 |
</div>
|
104 |
|
105 |
-
<div className="
|
106 |
-
<
|
107 |
-
<
|
108 |
-
<
|
109 |
-
<
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
onClick={() => handleSort(benchmark)}
|
115 |
-
className="py-3 px-6 text-left font-medium text-gray-700 cursor-pointer hover:text-blue-600"
|
116 |
-
>
|
117 |
-
<div className="flex items-center gap-1">
|
118 |
-
{benchmark}
|
119 |
-
<span className="text-gray-400">-</span>
|
120 |
-
</div>
|
121 |
-
</th>
|
122 |
-
))}
|
123 |
-
</tr>
|
124 |
-
</thead>
|
125 |
-
<tbody>
|
126 |
-
{filteredAndSortedData.map((item, index) => (
|
127 |
-
<tr
|
128 |
-
key={index}
|
129 |
-
className={`border-b border-gray-100 ${
|
130 |
-
index % 2 === 0 ? 'bg-white' : 'bg-gray-50'
|
131 |
-
}`}
|
132 |
>
|
133 |
-
|
134 |
-
|
135 |
-
</td>
|
136 |
-
<td className="py-3 px-6">
|
137 |
-
<ScoreBar score={item.scores.GAIA} />
|
138 |
-
</td>
|
139 |
-
<td className="py-3 px-6">
|
140 |
-
<ScoreBar score={item.scores.MATH} />
|
141 |
-
</td>
|
142 |
-
<td className="py-3 px-6">
|
143 |
-
<ScoreBar score={item.scores.SimpleQA} />
|
144 |
-
</td>
|
145 |
-
</tr>
|
146 |
))}
|
147 |
-
</
|
148 |
-
</
|
149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
</div>
|
151 |
</div>
|
152 |
);
|
|
|
1 |
import React, { useState, useEffect } from 'react';
|
2 |
import _ from 'lodash';
|
3 |
+
import './App.css';
|
4 |
+
|
5 |
const ScoreBar = ({ score }) => {
|
6 |
const percentage = score <= 1 ? score * 100 : score;
|
|
|
|
|
7 |
|
8 |
return (
|
9 |
+
<div className="score-bar">
|
10 |
<div
|
11 |
+
className="score-fill"
|
12 |
+
style={{ width: `${percentage}%` }}
|
|
|
|
|
|
|
13 |
/>
|
14 |
+
<span className="score-text">{percentage.toFixed(1)}%</span>
|
|
|
|
|
|
|
|
|
15 |
</div>
|
16 |
);
|
17 |
};
|
|
|
59 |
)
|
60 |
.value();
|
61 |
|
62 |
+
if (loading) return <div className="container">Loading benchmark results...</div>;
|
63 |
+
if (error) return <div className="container" style={{color: 'red'}}>Error: {error}</div>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
return (
|
66 |
+
<div className="container">
|
67 |
+
<div className="header">
|
68 |
+
<h1 className="title">Model Benchmark Results</h1>
|
69 |
+
<p className="subtitle">Comparing model performance across different benchmarks</p>
|
70 |
</div>
|
71 |
|
72 |
+
<div className="search-container">
|
73 |
+
<input
|
74 |
+
type="text"
|
75 |
+
className="search-input"
|
76 |
+
placeholder="Search models..."
|
77 |
+
value={searchQuery}
|
78 |
+
onChange={(e) => setSearchQuery(e.target.value)}
|
79 |
+
/>
|
|
|
|
|
|
|
80 |
</div>
|
81 |
|
82 |
+
<div className="table-container">
|
83 |
+
<table>
|
84 |
+
<thead>
|
85 |
+
<tr>
|
86 |
+
<th>Model</th>
|
87 |
+
{["GAIA", "MATH", "SimpleQA"].map(benchmark => (
|
88 |
+
<th
|
89 |
+
key={benchmark}
|
90 |
+
onClick={() => handleSort(benchmark)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
>
|
92 |
+
{benchmark} -
|
93 |
+
</th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
))}
|
95 |
+
</tr>
|
96 |
+
</thead>
|
97 |
+
<tbody>
|
98 |
+
{filteredAndSortedData.map((item, index) => (
|
99 |
+
<tr key={index}>
|
100 |
+
<td className="model-name">{item.model_id}</td>
|
101 |
+
<td><ScoreBar score={item.scores.GAIA} /></td>
|
102 |
+
<td><ScoreBar score={item.scores.MATH} /></td>
|
103 |
+
<td><ScoreBar score={item.scores.SimpleQA} /></td>
|
104 |
+
</tr>
|
105 |
+
))}
|
106 |
+
</tbody>
|
107 |
+
</table>
|
108 |
</div>
|
109 |
</div>
|
110 |
);
|