Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -115,7 +115,7 @@ def generate_info_callout(ratio, scope_text):
|
|
| 115 |
return (
|
| 116 |
f'<div style="text-align: right;">'
|
| 117 |
f'<div style="display:inline-block; max-width:250px; font-size:0.8em; background-color:#e6ffe6; padding:8px; border-radius:5px;">'
|
| 118 |
-
f'💡 There\'s a <strong>{ratio:,.1f}x</strong>
|
| 119 |
f'</div></div>'
|
| 120 |
)
|
| 121 |
|
|
@@ -170,7 +170,8 @@ def update_text_generation(selected_display, sort_order):
|
|
| 170 |
return df
|
| 171 |
df = process_df('text_generation.csv', sort_order, filter_fn)
|
| 172 |
ratio = compute_efficiency_ratio(df)
|
| 173 |
-
|
|
|
|
| 174 |
table_html = generate_html_table_from_df(df)
|
| 175 |
return callout, table_html
|
| 176 |
|
|
@@ -469,4 +470,4 @@ with demo:
|
|
| 469 |
)
|
| 470 |
gr.Markdown("Last updated: February 2025")
|
| 471 |
|
| 472 |
-
demo.launch()
|
|
|
|
| 115 |
return (
|
| 116 |
f'<div style="text-align: right;">'
|
| 117 |
f'<div style="display:inline-block; max-width:250px; font-size:0.8em; background-color:#e6ffe6; padding:8px; border-radius:5px;">'
|
| 118 |
+
f'💡 There\'s a <strong>{ratio:,.1f}x</strong> difference between the highest and lowest energy use in {scope_text}.'
|
| 119 |
f'</div></div>'
|
| 120 |
)
|
| 121 |
|
|
|
|
| 170 |
return df
|
| 171 |
df = process_df('text_generation.csv', sort_order, filter_fn)
|
| 172 |
ratio = compute_efficiency_ratio(df)
|
| 173 |
+
# Change the info_callout text to end with "in this class" for Text Generation
|
| 174 |
+
callout = generate_info_callout(ratio, "this class")
|
| 175 |
table_html = generate_html_table_from_df(df)
|
| 176 |
return callout, table_html
|
| 177 |
|
|
|
|
| 470 |
)
|
| 471 |
gr.Markdown("Last updated: February 2025")
|
| 472 |
|
| 473 |
+
demo.launch()
|