Spaces:
Sleeping
Sleeping
testing
Browse files- app.py +12 -24
- data/text_classification.csv +14 -0
app.py
CHANGED
@@ -1,27 +1,17 @@
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
from huggingface_hub import list_models
|
4 |
-
|
5 |
-
|
6 |
-
def
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
make_clickable_user(user_id),
|
16 |
-
make_clickable_model(submission.id),
|
17 |
-
submission.likes,
|
18 |
-
)
|
19 |
-
)
|
20 |
-
|
21 |
-
df = pd.DataFrame(data=leaderboard_models, columns=["User", "Model", "Likes"])
|
22 |
-
df.sort_values(by=["Likes"], ascending=False, inplace=True)
|
23 |
-
df.insert(0, "Rank", list(range(1, len(df) + 1)))
|
24 |
-
return df
|
25 |
|
26 |
# %% app.ipynb 3
|
27 |
demo = gr.Blocks()
|
@@ -45,9 +35,7 @@ with demo:
|
|
45 |
)
|
46 |
with gr.TabItem("Text Classification π"):
|
47 |
with gr.Row():
|
48 |
-
|
49 |
-
type="pandas", datatype=["number", "markdown", "markdown", "number"]
|
50 |
-
)
|
51 |
with gr.TabItem("Image Classification πΌοΈ"):
|
52 |
with gr.Row():
|
53 |
landscape_data = gr.components.Dataframe(
|
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
from huggingface_hub import list_models
|
4 |
+
import plotly.express as px
|
5 |
+
|
6 |
+
def get_plots(task_df):
|
7 |
+
grouped_df = task_df[['total_gpu_energy', 'model']].groupby('model').mean().sort_values('total_gpu_energy',ascending = False)
|
8 |
+
grouped_df = grouped_df.reset_index()
|
9 |
+
grouped_df['model'] = grouped_df['model'].str.split('/').str[-1]
|
10 |
+
grouped_df['task'] = 'text_classification'
|
11 |
+
grouped_df['total_gpu_energy (Wh)'] = grouped_df['total_gpu_energy']*1000
|
12 |
+
grouped_df['energy_star'] = pd.cut(grouped_df['total_gpu_energy (Wh)'], 3, labels=["βββ", "ββ", "β"])
|
13 |
+
grouped_df = px.scatter(grouped_df, x="model", y="total_gpu_energy (Wh)", height= 500, width= 800, color = 'energy_star', color_discrete_map={"β": 'red', "ββ": "yellow", "βββ": "green"})
|
14 |
+
return grouped_df
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
# %% app.ipynb 3
|
17 |
demo = gr.Blocks()
|
|
|
35 |
)
|
36 |
with gr.TabItem("Text Classification π"):
|
37 |
with gr.Row():
|
38 |
+
plot = gr.Plot(get_plots('data/text_classification.csv'))
|
|
|
|
|
39 |
with gr.TabItem("Image Classification πΌοΈ"):
|
40 |
with gr.Row():
|
41 |
landscape_data = gr.components.Dataframe(
|
data/text_classification.csv
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,timestamp,task,model,dataset,total_gpu_energy
|
2 |
+
0,2024-09-04-20-43-25,text_classification,nlptown/bert-base-multilingual-uncased-sentiment,EnergyStarAI/text_classification,0.0003565813408208385
|
3 |
+
0,2024-09-04-20-53-52,text_classification,bhadresh-savani/electra-base-emotion,EnergyStarAI/text_classification,0.0002521368683758851
|
4 |
+
0,2024-09-04-20-46-36,text_classification,distilbert/distilbert-base-uncased-finetuned-sst-2-english,EnergyStarAI/text_classification,0.00021773597974501514
|
5 |
+
0,2024-09-04-20-51-02,text_classification,michelecafagna26/gpt2-medium-finetuned-sst2-sentiment,EnergyStarAI/text_classification,0.0008015121412091375
|
6 |
+
0,2024-09-04-20-49-06,text_classification,lxyuan/distilbert-base-multilingual-cased-sentiments-student,EnergyStarAI/text_classification,0.00022141689935395448
|
7 |
+
0,2024-09-04-20-48-33,text_classification,mnoukhov/gpt2-imdb-sentiment-classifier,EnergyStarAI/text_classification,0.00031876844945895045
|
8 |
+
0,2024-09-04-20-28-47,text_classification,lvwerra/distilbert-imdb,EnergyStarAI/text_classification,0.00021602192281751088
|
9 |
+
0,2024-09-04-20-44-33,text_classification,Cheng98/bert-large-sst2,EnergyStarAI/text_classification,0.0009180142621886489
|
10 |
+
0,2024-09-04-22-01-22,text_classification_t5,google-t5/t5-large,EnergyStarAI/text_classification,0.00791976258580498
|
11 |
+
0,2024-09-04-22-09-36,text_classification_t5,google-t5/t5-11b,EnergyStarAI/text_classification,0.027787078868534286
|
12 |
+
0,2024-09-04-22-01-30,text_classification_t5,google-t5/t5-3b,EnergyStarAI/text_classification,0.011680515899960752
|
13 |
+
0,2024-09-04-21-35-23,text_classification_t5,google-t5/t5-base,EnergyStarAI/text_classification,0.004126364467755295
|
14 |
+
0,2024-09-04-22-01-48,text_classification_t5,google-t5/t5-small,EnergyStarAI/text_classification,0.0022160669117411657
|