
''')
# --- Subtitle (centered) ---
gr.Markdown('
Welcome to the AI Energy Score leaderboard. Select different tasks to see scored models.
')
# --- Tabs for the different tasks ---
with gr.Tabs():
# --- Text Generation Tab ---
with gr.TabItem("Text Generation 💬"):
with gr.Row():
model_class_options = [
"A (Single Consumer GPU) <20B parameters",
"B (Single Cloud GPU) 20-66B parameters",
"C (Multiple Cloud GPUs) >66B parameters"
]
model_class_dropdown = gr.Dropdown(
choices=model_class_options,
label="Select Model Class",
value=model_class_options[0]
)
sort_dropdown_tg = gr.Dropdown(
choices=["Low to High", "High to Low"],
label="Sort",
value="Low to High"
)
tg_table = gr.HTML(get_text_generation_model_names_html("A", "Low to High"))
model_class_dropdown.change(fn=update_text_generation, inputs=[model_class_dropdown, sort_dropdown_tg], outputs=tg_table)
sort_dropdown_tg.change(fn=update_text_generation, inputs=[model_class_dropdown, sort_dropdown_tg], outputs=tg_table)
# --- Image Generation Tab ---
with gr.TabItem("Image Generation 📷"):
sort_dropdown_img = gr.Dropdown(
choices=["Low to High", "High to Low"],
label="Sort",
value="Low to High"
)
img_table = gr.HTML(get_model_names_html('image_generation.csv', "Low to High"))
sort_dropdown_img.change(fn=update_image_generation, inputs=sort_dropdown_img, outputs=img_table)
# --- Text Classification Tab ---
with gr.TabItem("Text Classification 🎭"):
sort_dropdown_tc = gr.Dropdown(
choices=["Low to High", "High to Low"],
label="Sort",
value="Low to High"
)
tc_table = gr.HTML(get_model_names_html('text_classification.csv', "Low to High"))
sort_dropdown_tc.change(fn=update_text_classification, inputs=sort_dropdown_tc, outputs=tc_table)
# --- Image Classification Tab ---
with gr.TabItem("Image Classification 🖼️"):
sort_dropdown_ic = gr.Dropdown(
choices=["Low to High", "High to Low"],
label="Sort",
value="Low to High"
)
ic_table = gr.HTML(get_model_names_html('image_classification.csv', "Low to High"))
sort_dropdown_ic.change(fn=update_image_classification, inputs=sort_dropdown_ic, outputs=ic_table)
# --- Image Captioning Tab ---
with gr.TabItem("Image Captioning 📝"):
sort_dropdown_icap = gr.Dropdown(
choices=["Low to High", "High to Low"],
label="Sort",
value="Low to High"
)
icap_table = gr.HTML(get_model_names_html('image_captioning.csv', "Low to High"))
sort_dropdown_icap.change(fn=update_image_captioning, inputs=sort_dropdown_icap, outputs=icap_table)
# --- Summarization Tab ---
with gr.TabItem("Summarization 📃"):
sort_dropdown_sum = gr.Dropdown(
choices=["Low to High", "High to Low"],
label="Sort",
value="Low to High"
)
sum_table = gr.HTML(get_model_names_html('summarization.csv', "Low to High"))
sort_dropdown_sum.change(fn=update_summarization, inputs=sort_dropdown_sum, outputs=sum_table)
# --- Automatic Speech Recognition Tab ---
with gr.TabItem("Automatic Speech Recognition 💬"):
sort_dropdown_asr = gr.Dropdown(
choices=["Low to High", "High to Low"],
label="Sort",
value="Low to High"
)
asr_table = gr.HTML(get_model_names_html('asr.csv', "Low to High"))
sort_dropdown_asr.change(fn=update_asr, inputs=sort_dropdown_asr, outputs=asr_table)
# --- Object Detection Tab ---
with gr.TabItem("Object Detection 🚘"):
sort_dropdown_od = gr.Dropdown(
choices=["Low to High", "High to Low"],
label="Sort",
value="Low to High"
)
od_table = gr.HTML(get_model_names_html('object_detection.csv', "Low to High"))
sort_dropdown_od.change(fn=update_object_detection, inputs=sort_dropdown_od, outputs=od_table)
# --- Sentence Similarity Tab ---
with gr.TabItem("Sentence Similarity 📚"):
sort_dropdown_ss = gr.Dropdown(
choices=["Low to High", "High to Low"],
label="Sort",
value="Low to High"
)
ss_table = gr.HTML(get_model_names_html('sentence_similarity.csv', "Low to High"))
sort_dropdown_ss.change(fn=update_sentence_similarity, inputs=sort_dropdown_ss, outputs=ss_table)
# --- Extractive QA Tab ---
with gr.TabItem("Extractive QA ❔"):
sort_dropdown_qa = gr.Dropdown(
choices=["Low to High", "High to Low"],
label="Sort",
value="Low to High"
)
qa_table = gr.HTML(get_model_names_html('question_answering.csv', "Low to High"))
sort_dropdown_qa.change(fn=update_extractive_qa, inputs=sort_dropdown_qa, outputs=qa_table)
# --- All Tasks Tab ---
with gr.TabItem("All Tasks 💡"):
sort_dropdown_all = gr.Dropdown(
choices=["Low to High", "High to Low"],
label="Sort",
value="Low to High"
)
all_table = gr.HTML(get_all_model_names_html("Low to High"))
sort_dropdown_all.change(fn=update_all_tasks, inputs=sort_dropdown_all, outputs=all_table)
with gr.Accordion("📙 Citation", open=False):
citation_button = gr.Textbox(
value=CITATION_BUTTON_TEXT,
label=CITATION_BUTTON_LABEL,
elem_id="citation-button",
lines=10,
show_copy_button=True,
)
gr.Markdown("Last updated: February 2025")
demo.launch()