Spaces:
Sleeping
Sleeping
Sidebar unbloat
Browse files
app.py
CHANGED
|
@@ -248,25 +248,13 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css()) as demo:
|
|
| 248 |
# Sidebar for model selection
|
| 249 |
with gr.Column(scale=1, elem_classes=["sidebar"]):
|
| 250 |
gr.Markdown("# π€ TCID")
|
| 251 |
-
gr.Markdown("**Transformer CI Dashboard**\n\n*Result overview by model and hardware*\n")
|
| 252 |
|
| 253 |
-
#
|
| 254 |
if Ci_results.last_update_time:
|
| 255 |
-
|
| 256 |
else:
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
# Manual refresh button
|
| 261 |
-
refresh_button = gr.Button(
|
| 262 |
-
"π refresh data",
|
| 263 |
-
variant="secondary",
|
| 264 |
-
size="sm",
|
| 265 |
-
elem_classes=["refresh-button"]
|
| 266 |
-
)
|
| 267 |
-
|
| 268 |
-
# CI job links
|
| 269 |
-
ci_links_display = gr.Markdown("π **CI Jobs:** *Loading...*")
|
| 270 |
|
| 271 |
# Summary button at the top
|
| 272 |
summary_button = gr.Button(
|
|
@@ -288,6 +276,9 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css()) as demo:
|
|
| 288 |
interactive=True,
|
| 289 |
allow_custom_value=False
|
| 290 |
)
|
|
|
|
|
|
|
|
|
|
| 291 |
|
| 292 |
# Main content area
|
| 293 |
with gr.Column(scale=4, elem_classes=["main-content"]):
|
|
@@ -344,23 +335,23 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css()) as demo:
|
|
| 344 |
# Summary button click handler
|
| 345 |
def show_summary_and_update_links():
|
| 346 |
"""Show summary page and update CI links."""
|
| 347 |
-
return create_summary_page(Ci_results.df, Ci_results.available_models), get_ci_links()
|
| 348 |
|
| 349 |
summary_button.click(
|
| 350 |
fn=show_summary_and_update_links,
|
| 351 |
-
outputs=[summary_display, ci_links_display]
|
| 352 |
).then(
|
| 353 |
fn=lambda: [gr.update(visible=True), gr.update(visible=False)],
|
| 354 |
outputs=[summary_display, detail_view]
|
| 355 |
)
|
| 356 |
|
| 357 |
-
# Function to get current
|
| 358 |
-
def
|
| 359 |
-
"""Get
|
| 360 |
if Ci_results.last_update_time:
|
| 361 |
-
return f"
|
| 362 |
else:
|
| 363 |
-
return f"
|
| 364 |
|
| 365 |
# Function to get CI job links
|
| 366 |
def get_ci_links():
|
|
@@ -428,19 +419,6 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css()) as demo:
|
|
| 428 |
logger.error(f"getting CI links: {e}")
|
| 429 |
return "π **CI Jobs:** *Error loading links*"
|
| 430 |
|
| 431 |
-
# Refresh button click handler
|
| 432 |
-
def refresh_data_and_status():
|
| 433 |
-
"""Manual data refresh triggered by user."""
|
| 434 |
-
Ci_results.load_data()
|
| 435 |
-
return create_summary_page(Ci_results.df, Ci_results.available_models), get_status_text(), get_ci_links()
|
| 436 |
-
|
| 437 |
-
refresh_button.click(
|
| 438 |
-
fn=refresh_data_and_status,
|
| 439 |
-
outputs=[summary_display, status_display, ci_links_display]
|
| 440 |
-
).then(
|
| 441 |
-
fn=lambda: [gr.update(visible=True), gr.update(visible=False)],
|
| 442 |
-
outputs=[summary_display, detail_view]
|
| 443 |
-
)
|
| 444 |
|
| 445 |
# Auto-update CI links when the interface loads
|
| 446 |
demo.load(
|
|
|
|
| 248 |
# Sidebar for model selection
|
| 249 |
with gr.Column(scale=1, elem_classes=["sidebar"]):
|
| 250 |
gr.Markdown("# π€ TCID")
|
|
|
|
| 251 |
|
| 252 |
+
# Description with integrated last update time
|
| 253 |
if Ci_results.last_update_time:
|
| 254 |
+
description_text = f"**Transformer CI Dashboard**\n\n*Result overview by model and hardware (last updated: {Ci_results.last_update_time})*\n"
|
| 255 |
else:
|
| 256 |
+
description_text = f"**Transformer CI Dashboard**\n\n*Result overview by model and hardware (loading...)*\n"
|
| 257 |
+
description_display = gr.Markdown(description_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
|
| 259 |
# Summary button at the top
|
| 260 |
summary_button = gr.Button(
|
|
|
|
| 276 |
interactive=True,
|
| 277 |
allow_custom_value=False
|
| 278 |
)
|
| 279 |
+
|
| 280 |
+
# CI job links at bottom of sidebar
|
| 281 |
+
ci_links_display = gr.Markdown("π **CI Jobs:** *Loading...*")
|
| 282 |
|
| 283 |
# Main content area
|
| 284 |
with gr.Column(scale=4, elem_classes=["main-content"]):
|
|
|
|
| 335 |
# Summary button click handler
|
| 336 |
def show_summary_and_update_links():
|
| 337 |
"""Show summary page and update CI links."""
|
| 338 |
+
return create_summary_page(Ci_results.df, Ci_results.available_models), get_description_text(), get_ci_links()
|
| 339 |
|
| 340 |
summary_button.click(
|
| 341 |
fn=show_summary_and_update_links,
|
| 342 |
+
outputs=[summary_display, description_display, ci_links_display]
|
| 343 |
).then(
|
| 344 |
fn=lambda: [gr.update(visible=True), gr.update(visible=False)],
|
| 345 |
outputs=[summary_display, detail_view]
|
| 346 |
)
|
| 347 |
|
| 348 |
+
# Function to get current description text
|
| 349 |
+
def get_description_text():
|
| 350 |
+
"""Get description text with integrated last update time."""
|
| 351 |
if Ci_results.last_update_time:
|
| 352 |
+
return f"**Transformer CI Dashboard**\n\n*Result overview by model and hardware (last updated: {Ci_results.last_update_time})*\n"
|
| 353 |
else:
|
| 354 |
+
return f"**Transformer CI Dashboard**\n\n*Result overview by model and hardware (loading...)*\n"
|
| 355 |
|
| 356 |
# Function to get CI job links
|
| 357 |
def get_ci_links():
|
|
|
|
| 419 |
logger.error(f"getting CI links: {e}")
|
| 420 |
return "π **CI Jobs:** *Error loading links*"
|
| 421 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 422 |
|
| 423 |
# Auto-update CI links when the interface loads
|
| 424 |
demo.load(
|