Spaces:
Running
Running
File size: 2,100 Bytes
460fdc7 42e8f64 f913e34 8805c59 f7b4006 d4ded0a 17e9fa3 d4ded0a 7022131 f7b4006 7022131 7786ff5 7022131 7786ff5 f7b4006 7022131 f7b4006 7786ff5 7022131 f7b4006 7786ff5 7022131 f7b4006 d4ded0a a43f014 d4ded0a 7022131 f7b4006 7786ff5 7022131 f7b4006 7786ff5 f7b4006 7022131 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
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
def get_model_names(task_data):
task_df= pd.read_csv(task_data)
return task_df['model'].tolist()
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():
with gr.Column():
plot = gr.Plot(get_plots('data/text_classification.csv'))
with gr.Column():
table = gr.Dataframe(get_model_names('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()
|