Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -75,7 +75,10 @@ def get_plots(task):
|
|
75 |
fig.update_layout(
|
76 |
xaxis_title="Model",
|
77 |
yaxis_title="GPU Energy (Wh)",
|
78 |
-
yaxis_tickformat=".4f" # Add this line to format y-axis ticks
|
|
|
|
|
|
|
79 |
)
|
80 |
return fig
|
81 |
|
@@ -113,7 +116,10 @@ def get_all_plots():
|
|
113 |
fig.update_layout(
|
114 |
xaxis_title="Model",
|
115 |
yaxis_title="GPU Energy (Wh)",
|
116 |
-
yaxis_tickformat=".4f" # Add this line to format y-axis ticks
|
|
|
|
|
|
|
117 |
)
|
118 |
return fig
|
119 |
|
@@ -171,6 +177,7 @@ def get_text_generation_plots(model_class):
|
|
171 |
width=800,
|
172 |
color_discrete_map=color_map
|
173 |
)
|
|
|
174 |
fig.update_traces(
|
175 |
hovertemplate="<br>".join([
|
176 |
"Model: %{x}",
|
@@ -181,7 +188,10 @@ def get_text_generation_plots(model_class):
|
|
181 |
fig.update_layout(
|
182 |
xaxis_title="Model",
|
183 |
yaxis_title="GPU Energy (Wh)",
|
184 |
-
yaxis_tickformat=".4f" # Add this line to format y-axis ticks
|
|
|
|
|
|
|
185 |
)
|
186 |
return fig
|
187 |
|
@@ -233,12 +243,12 @@ Select different tasks to see scored models. Submit open models for testing and
|
|
233 |
# Dropdown moved above the plot and leaderboard
|
234 |
model_class_dropdown = gr.Dropdown(choices=["A", "B", "C"],
|
235 |
label="Select Model Class",
|
236 |
-
value="
|
237 |
with gr.Row():
|
238 |
with gr.Column(scale=1.3):
|
239 |
-
tg_plot = gr.Plot(get_text_generation_plots("
|
240 |
with gr.Column(scale=1):
|
241 |
-
tg_table = gr.Dataframe(get_text_generation_model_names("
|
242 |
# Update plot and table when the dropdown value changes
|
243 |
model_class_dropdown.change(fn=update_text_generation,
|
244 |
inputs=model_class_dropdown,
|
|
|
75 |
fig.update_layout(
|
76 |
xaxis_title="Model",
|
77 |
yaxis_title="GPU Energy (Wh)",
|
78 |
+
yaxis_tickformat=".4f", # Add this line to format y-axis ticks
|
79 |
+
yaxis = dict(
|
80 |
+
tickformat=".4f" # Ensure tickformat is set within yaxis dict as well
|
81 |
+
)
|
82 |
)
|
83 |
return fig
|
84 |
|
|
|
116 |
fig.update_layout(
|
117 |
xaxis_title="Model",
|
118 |
yaxis_title="GPU Energy (Wh)",
|
119 |
+
yaxis_tickformat=".4f", # Add this line to format y-axis ticks
|
120 |
+
yaxis = dict(
|
121 |
+
tickformat=".4f" # Ensure tickformat is set within yaxis dict as well
|
122 |
+
)
|
123 |
)
|
124 |
return fig
|
125 |
|
|
|
177 |
width=800,
|
178 |
color_discrete_map=color_map
|
179 |
)
|
180 |
+
# Update hover text to show the model and GPU Energy (with 4 decimals)
|
181 |
fig.update_traces(
|
182 |
hovertemplate="<br>".join([
|
183 |
"Model: %{x}",
|
|
|
188 |
fig.update_layout(
|
189 |
xaxis_title="Model",
|
190 |
yaxis_title="GPU Energy (Wh)",
|
191 |
+
yaxis_tickformat=".4f", # Add this line to format y-axis ticks
|
192 |
+
yaxis = dict(
|
193 |
+
tickformat=".4f" # Ensure tickformat is set within yaxis dict as well
|
194 |
+
)
|
195 |
)
|
196 |
return fig
|
197 |
|
|
|
243 |
# Dropdown moved above the plot and leaderboard
|
244 |
model_class_dropdown = gr.Dropdown(choices=["A", "B", "C"],
|
245 |
label="Select Model Class",
|
246 |
+
value="C") # Default to C for testing
|
247 |
with gr.Row():
|
248 |
with gr.Column(scale=1.3):
|
249 |
+
tg_plot = gr.Plot(get_text_generation_plots("C")) # Default to C for testing
|
250 |
with gr.Column(scale=1):
|
251 |
+
tg_table = gr.Dataframe(get_text_generation_model_names("C"), datatype="markdown")
|
252 |
# Update plot and table when the dropdown value changes
|
253 |
model_class_dropdown.change(fn=update_text_generation,
|
254 |
inputs=model_class_dropdown,
|