TheoLvs commited on
Commit
39ae615
·
1 Parent(s): 6e56fdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -20
app.py CHANGED
@@ -144,9 +144,31 @@ def submit_results(task: str, results_json):
144
  return gr.Warning(f"Error submitting results: {str(e)}")
145
 
146
  # Create the demo interface
147
- with gr.Blocks() as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
  gr.Image("./logo.png", show_label=False, container=False)
 
150
  gr.Markdown("""
151
  # Frugal AI Challenge - Submission Portal
152
  Submit your model results for any of the three tasks: Text, Image, or Audio classification.
@@ -213,7 +235,7 @@ The goal of the Frugal AI Challenge is to encourage both academic and industry a
213
  with gr.Column(scale=1):
214
  text_submit_btn = gr.Button("2. Submit to public leaderboard (optional)", variant="secondary")
215
  with gr.Column(scale=1):
216
- text_submit_btn2 = gr.Button("3. Submit to final evaluation (form)", variant="primary")
217
 
218
  with gr.Row():
219
  text_accuracy = gr.Number(label="Accuracy", precision=4)
@@ -242,7 +264,7 @@ The goal of the Frugal AI Challenge is to encourage both academic and industry a
242
  with gr.Column(scale=1):
243
  image_submit_btn = gr.Button("2. Submit to public leaderboard (optional)", variant="secondary")
244
  with gr.Column(scale=1):
245
- image_submit_btn2 = gr.Button("3. Submit to final evaluation (form)", variant="primary")
246
 
247
  with gr.Row():
248
  image_accuracy = gr.Number(label="Accuracy", precision=4)
@@ -271,7 +293,7 @@ The goal of the Frugal AI Challenge is to encourage both academic and industry a
271
  with gr.Column(scale=1):
272
  audio_submit_btn = gr.Button("2. Submit to public leaderboard (optional)", variant="secondary")
273
  with gr.Column(scale=1):
274
- audio_submit_btn2 = gr.Button("3. Submit to final evaluation (form)", variant="primary")
275
 
276
  with gr.Row():
277
  audio_accuracy = gr.Number(label="Accuracy", precision=4)
@@ -294,10 +316,10 @@ The goal of the Frugal AI Challenge is to encourage both academic and industry a
294
  outputs=[text_accuracy, text_emissions, text_energy, text_results_json]
295
  )
296
 
297
- text_submit_btn2.click(
298
- fn=open_form,
299
- inputs=[],
300
- outputs=[]
301
  )
302
 
303
  image_evaluate_btn.click(
@@ -312,12 +334,6 @@ The goal of the Frugal AI Challenge is to encourage both academic and industry a
312
  outputs=None
313
  )
314
 
315
- image_submit_btn2.click(
316
- fn=open_form,
317
- inputs=[],
318
- outputs=[]
319
- )
320
-
321
  audio_evaluate_btn.click(
322
  lambda url, route: evaluate_model(route.strip("/"), url),
323
  inputs=[audio_space_url, audio_route],
@@ -329,12 +345,6 @@ The goal of the Frugal AI Challenge is to encourage both academic and industry a
329
  inputs=[audio_results_json],
330
  outputs=None
331
  )
332
-
333
- audio_submit_btn2.click(
334
- fn=open_form,
335
- inputs=[],
336
- outputs=[]
337
- )
338
 
339
  if __name__ == "__main__":
340
  demo.launch()
 
144
  return gr.Warning(f"Error submitting results: {str(e)}")
145
 
146
  # Create the demo interface
147
+ with gr.Blocks(css="""
148
+ .button-link {
149
+ display: inline-block;
150
+ padding: 0.5rem 1.5rem;
151
+ background-color: #FF7C01;
152
+ color: white !important;
153
+ text-decoration: none;
154
+ border-radius: 0.5rem;
155
+ border: none;
156
+ cursor: pointer;
157
+ text-align: center;
158
+ font-weight: 600;
159
+ width: 100%;
160
+ box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
161
+ transition: all 0.3s cubic-bezier(.25,.8,.25,1);
162
+ }
163
+ .button-link:hover {
164
+ background-color: #E66E00;
165
+ box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
166
+ text-decoration: none;
167
+ }
168
+ """) as demo:
169
 
170
  gr.Image("./logo.png", show_label=False, container=False)
171
+
172
  gr.Markdown("""
173
  # Frugal AI Challenge - Submission Portal
174
  Submit your model results for any of the three tasks: Text, Image, or Audio classification.
 
235
  with gr.Column(scale=1):
236
  text_submit_btn = gr.Button("2. Submit to public leaderboard (optional)", variant="secondary")
237
  with gr.Column(scale=1):
238
+ gr.Markdown("""<a href="https://framaforms.org/2025-frugal-ai-challenge-submission-form-1736883260-0" target="_blank" class="button-link">3. Submit to final evaluation (form)</a>""")
239
 
240
  with gr.Row():
241
  text_accuracy = gr.Number(label="Accuracy", precision=4)
 
264
  with gr.Column(scale=1):
265
  image_submit_btn = gr.Button("2. Submit to public leaderboard (optional)", variant="secondary")
266
  with gr.Column(scale=1):
267
+ gr.Markdown("""<a href="https://framaforms.org/2025-frugal-ai-challenge-submission-form-1736883260-0" target="_blank" class="button-link">3. Submit to final evaluation (form)</a>""")
268
 
269
  with gr.Row():
270
  image_accuracy = gr.Number(label="Accuracy", precision=4)
 
293
  with gr.Column(scale=1):
294
  audio_submit_btn = gr.Button("2. Submit to public leaderboard (optional)", variant="secondary")
295
  with gr.Column(scale=1):
296
+ gr.Markdown("""<a href="https://framaforms.org/2025-frugal-ai-challenge-submission-form-1736883260-0" target="_blank" class="button-link">3. Submit to final evaluation (form)</a>""")
297
 
298
  with gr.Row():
299
  audio_accuracy = gr.Number(label="Accuracy", precision=4)
 
316
  outputs=[text_accuracy, text_emissions, text_energy, text_results_json]
317
  )
318
 
319
+ text_submit_btn.click(
320
+ lambda results: submit_results("text", results),
321
+ inputs=[text_results_json],
322
+ outputs=None
323
  )
324
 
325
  image_evaluate_btn.click(
 
334
  outputs=None
335
  )
336
 
 
 
 
 
 
 
337
  audio_evaluate_btn.click(
338
  lambda url, route: evaluate_model(route.strip("/"), url),
339
  inputs=[audio_space_url, audio_route],
 
345
  inputs=[audio_results_json],
346
  outputs=None
347
  )
 
 
 
 
 
 
348
 
349
  if __name__ == "__main__":
350
  demo.launch()