openreviewer commited on
Commit
b11f9e3
1 Parent(s): 7cdd6df

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +18 -52
app.py CHANGED
@@ -166,8 +166,11 @@ def setup_interface():
166
 
167
  with gr.TabItem("Leaderboard"):
168
  gr.Markdown("## Leaderboard")
 
169
  # Fetch the leaderboard data from the database
170
  leaderboard_data = get_leaderboard()
 
 
171
  leaderboard_html = """
172
  <table style="width:100%; border: 1px solid #444; border-collapse: collapse; font-family: Arial, sans-serif; background-color: #2b2b2b;">
173
  <thead>
@@ -183,59 +186,22 @@ def setup_interface():
183
  </tr>
184
  </thead>
185
  <tbody>
186
- <tr style="border: 1px solid #444; padding: 12px;">
187
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">1</td>
188
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">GPT-4-Turbo-2024-04-09</td>
189
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">1258</td>
190
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">+3/-3</td>
191
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">44592</td>
192
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">OpenAI</td>
193
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">Proprietary</td>
194
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">2023/12</td>
195
- </tr>
196
- <tr style="border: 1px solid #444; padding: 12px;">
197
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">2</td>
198
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">GPT-4-1106-preview</td>
199
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">1252</td>
200
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">+2/-3</td>
201
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">76173</td>
202
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">OpenAI</td>
203
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">Proprietary</td>
204
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">2023/4</td>
205
- </tr>
206
- <tr style="border: 1px solid #444; padding: 12px;">
207
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">2</td>
208
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">Gemini 1.5 Pro API-0409-Preview</td>
209
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">1249</td>
210
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">+3/-3</td>
211
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">61011</td>
212
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">Google</td>
213
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">Proprietary</td>
214
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">2023/11</td>
215
- </tr>
216
- <tr style="border: 1px solid #444; padding: 12px;">
217
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">2</td>
218
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">Claude 3 Opus</td>
219
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">1248</td>
220
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">+2/-2</td>
221
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">101063</td>
222
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">Anthropic</td>
223
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">Proprietary</td>
224
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">2023/8</td>
225
- </tr>
226
- <tr style="border: 1px solid #444; padding: 12px;">
227
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">3</td>
228
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">GPT-4-0125-preview</td>
229
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">1246</td>
230
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">+3/-2</td>
231
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">70239</td>
232
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">OpenAI</td>
233
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">Proprietary</td>
234
- <td style="border: 1px solid #444; padding: 12px; color: #ddd;">2023/12</td>
235
- </tr>
236
- </tbody>
237
- </table>
238
  """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  leaderboard_html += """
240
  </tbody>
241
  </table>
 
166
 
167
  with gr.TabItem("Leaderboard"):
168
  gr.Markdown("## Leaderboard")
169
+
170
  # Fetch the leaderboard data from the database
171
  leaderboard_data = get_leaderboard()
172
+
173
+ # Create the leaderboard HTML dynamically
174
  leaderboard_html = """
175
  <table style="width:100%; border: 1px solid #444; border-collapse: collapse; font-family: Arial, sans-serif; background-color: #2b2b2b;">
176
  <thead>
 
186
  </tr>
187
  </thead>
188
  <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  """
190
+
191
+ for rank, model in enumerate(leaderboard_data, start=1):
192
+ leaderboard_html += f"""
193
+ <tr style="border: 1px solid #444; padding: 12px;">
194
+ <td style="border: 1px solid #444; padding: 12px; color: #ddd;">{rank}</td>
195
+ <td style="border: 1px solid #444; padding: 12px; color: #ddd;">{model['ModelID']}</td>
196
+ <td style="border: 1px solid #444; padding: 12px; color: #ddd;">{model['EloScore']}</td>
197
+ <td style="border: 1px solid #444; padding: 12px; color: #ddd;">+3/-3</td> <!-- Adjust as needed -->
198
+ <td style="border: 1px solid #444; padding: 12px; color: #ddd;">{model['Votes']}</td>
199
+ <td style="border: 1px solid #444; padding: 12px; color: #ddd;">Organization</td> <!-- Add actual data if available -->
200
+ <td style="border: 1px solid #444; padding: 12px; color: #ddd;">License</td> <!-- Add actual data if available -->
201
+ <td style="border: 1px solid #444; padding: 12px; color: #ddd;">Knowledge Cutoff</td> <!-- Add actual data if available -->
202
+ </tr>
203
+ """
204
+
205
  leaderboard_html += """
206
  </tbody>
207
  </table>