|
import gradio as gr |
|
import pandas as pd |
|
from huggingface_hub import list_models |
|
import plotly.express as px |
|
|
|
def get_plots(task_data): |
|
task_df= pd.read_csv(task_data) |
|
task_df['total_gpu_energy (Wh)'] = task_df['total_gpu_energy']*1000 |
|
task_df['energy_star'] = pd.cut(task_df['total_gpu_energy (Wh)'], 3, labels=["βββ", "ββ", "β"]) |
|
task_df = px.scatter(task_df, x="model", y="total_gpu_energy (Wh)", height= 500, width= 800, color = 'energy_star', color_discrete_map={"β": 'red', "ββ": "yellow", "βββ": "green"}) |
|
return task_df |
|
|
|
|
|
demo = gr.Blocks() |
|
|
|
with demo: |
|
gr.Markdown( |
|
"""# Energy Star Leaderboard |
|
|
|
TODO """ |
|
) |
|
with gr.Tabs(): |
|
with gr.TabItem("Text Generation π¬"): |
|
with gr.Row(): |
|
animal_data = gr.components.Dataframe( |
|
type="pandas", datatype=["number", "markdown", "markdown", "number"] |
|
) |
|
with gr.TabItem("Image Generation π·"): |
|
with gr.Row(): |
|
science_data = gr.components.Dataframe( |
|
type="pandas", datatype=["number", "markdown", "markdown", "number"] |
|
) |
|
with gr.TabItem("Text Classification π"): |
|
with gr.Row(): |
|
plot = gr.Plot(get_plots('data/text_classification.csv')) |
|
with gr.TabItem("Image Classification πΌοΈ"): |
|
with gr.Row(): |
|
landscape_data = gr.components.Dataframe( |
|
type="pandas", datatype=["number", "markdown", "markdown", "number"] |
|
) |
|
with gr.TabItem("Extractive QA β"): |
|
with gr.Row(): |
|
wildcard_data = gr.components.Dataframe( |
|
type="pandas", datatype=["number", "markdown", "markdown", "number"] |
|
) |
|
|
|
|
|
demo.launch() |
|
|