bgamazay commited on
Commit
fe6b2ac
·
verified ·
1 Parent(s): f66e432

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -12
app.py CHANGED
@@ -111,7 +111,12 @@ def get_zip_data_link():
111
  with open(zip_filename, "rb") as f:
112
  data = f.read()
113
  b64 = base64.b64encode(data).decode()
114
- href = f'<a href="data:application/zip;base64,{b64}" download="data.zip" style="margin: 0 15px; text-decoration: none; font-weight: bold; font-size: 1.1em;">Download Data</a>'
 
 
 
 
 
115
  return href
116
 
117
  # --- Modified functions to include a sort_order parameter ---
@@ -217,7 +222,36 @@ demo = gr.Blocks(css="""
217
  """)
218
 
219
  with demo:
220
- # Replace title with a centered logo and a centered subtitle.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  gr.HTML('''
222
  <div style="text-align: center; margin-top: 20px;">
223
  <img src="https://huggingface.co/spaces/AIEnergyScore/Leaderboard/resolve/main/logo.png"
@@ -226,17 +260,10 @@ with demo:
226
  </div>
227
  ''')
228
 
229
- gr.Markdown('<p style="text-align: center;">Welcome to the leaderboard for the <a href="https://huggingface.co/AIEnergyScore">AI Energy Score Project!</a> — Select different tasks to see scored models.</p>')
230
-
231
- # Header links (using a row of components, including a Download Data link)
232
- with gr.Row():
233
- submission_link = gr.HTML('<a href="https://huggingface.co/spaces/AIEnergyScore/submission_portal" style="margin: 0 10px; text-decoration: none; font-weight: bold; font-size: 1.1em;">Submission Portal</a>')
234
- label_link = gr.HTML('<a href="https://huggingface.co/spaces/AIEnergyScore/Label" style="margin: 0 10px; text-decoration: none; font-weight: bold; font-size: 1.1em;">Label Generator</a>')
235
- faq_link = gr.HTML('<a href="https://huggingface.github.io/AIEnergyScore/#faq" style="margin: 0 10px; text-decoration: none; font-weight: bold; font-size: 1.1em;">FAQ</a>')
236
- documentation_link = gr.HTML('<a href="https://huggingface.github.io/AIEnergyScore/#documentation" style="margin: 0 10px; text-decoration: none; font-weight: bold; font-size: 1.1em;">Documentation</a>')
237
- download_link = gr.HTML(get_zip_data_link())
238
- community_link = gr.HTML('<a href="https://huggingface.co/spaces/AIEnergyScore/README/discussions" style="margin: 0 10px; text-decoration: none; font-weight: bold; font-size: 1.1em;">Community</a>')
239
 
 
240
  with gr.Tabs():
241
  # --- Text Generation Tab ---
242
  with gr.TabItem("Text Generation 💬"):
 
111
  with open(zip_filename, "rb") as f:
112
  data = f.read()
113
  b64 = base64.b64encode(data).decode()
114
+ href = (
115
+ f'<a href="data:application/zip;base64,{b64}" '
116
+ 'download="data.zip" '
117
+ 'style="margin: 0 15px; text-decoration: none; font-weight: bold; font-size: 1.1em; '
118
+ 'color: black; font-family: \'Inter\', sans-serif;">Download Data</a>'
119
+ )
120
  return href
121
 
122
  # --- Modified functions to include a sort_order parameter ---
 
222
  """)
223
 
224
  with demo:
225
+ # --- Header Links (at the very top) ---
226
+ with gr.Row():
227
+ submission_link = gr.HTML(
228
+ '<a href="https://huggingface.co/spaces/AIEnergyScore/submission_portal" '
229
+ 'style="margin: 0 10px; text-decoration: none; font-weight: bold; font-size: 1.1em; '
230
+ 'color: black; font-family: \'Inter\', sans-serif;">Submission Portal</a>'
231
+ )
232
+ label_link = gr.HTML(
233
+ '<a href="https://huggingface.co/spaces/AIEnergyScore/Label" '
234
+ 'style="margin: 0 10px; text-decoration: none; font-weight: bold; font-size: 1.1em; '
235
+ 'color: black; font-family: \'Inter\', sans-serif;">Label Generator</a>'
236
+ )
237
+ faq_link = gr.HTML(
238
+ '<a href="https://huggingface.github.io/AIEnergyScore/#faq" '
239
+ 'style="margin: 0 10px; text-decoration: none; font-weight: bold; font-size: 1.1em; '
240
+ 'color: black; font-family: \'Inter\', sans-serif;">FAQ</a>'
241
+ )
242
+ documentation_link = gr.HTML(
243
+ '<a href="https://huggingface.github.io/AIEnergyScore/#documentation" '
244
+ 'style="margin: 0 10px; text-decoration: none; font-weight: bold; font-size: 1.1em; '
245
+ 'color: black; font-family: \'Inter\', sans-serif;">Documentation</a>'
246
+ )
247
+ download_link = gr.HTML(get_zip_data_link())
248
+ community_link = gr.HTML(
249
+ '<a href="https://huggingface.co/spaces/AIEnergyScore/README/discussions" '
250
+ 'style="margin: 0 10px; text-decoration: none; font-weight: bold; font-size: 1.1em; '
251
+ 'color: black; font-family: \'Inter\', sans-serif;">Community</a>'
252
+ )
253
+
254
+ # --- Logo (centered) ---
255
  gr.HTML('''
256
  <div style="text-align: center; margin-top: 20px;">
257
  <img src="https://huggingface.co/spaces/AIEnergyScore/Leaderboard/resolve/main/logo.png"
 
260
  </div>
261
  ''')
262
 
263
+ # --- Subtitle (centered) ---
264
+ gr.Markdown('<p style="text-align: center;">Welcome to the <a href="https://huggingface.co/AIEnergyScore">AI Energy Score</a> Leaderboard. Select the task to see scored model results.</p>')
 
 
 
 
 
 
 
 
265
 
266
+ # --- Tabs for the different tasks ---
267
  with gr.Tabs():
268
  # --- Text Generation Tab ---
269
  with gr.TabItem("Text Generation 💬"):