Spaces:
Running
Running
Added the summary page, issues with component height
Browse files
app.py
CHANGED
@@ -223,6 +223,89 @@ def get_model_stats_summary(model_name: str) -> tuple:
|
|
223 |
|
224 |
return total, success_rate, status_class
|
225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
# Custom CSS for dark theme
|
227 |
dark_theme_css = """
|
228 |
/* Global dark theme */
|
@@ -328,11 +411,34 @@ dark_theme_css = """
|
|
328 |
border-color: #666666 !important;
|
329 |
}
|
330 |
|
331 |
-
/* Plot container with smooth transitions */
|
332 |
.plot-container {
|
333 |
background-color: #000000 !important;
|
334 |
border: none !important;
|
335 |
transition: opacity 0.6s ease-in-out !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
}
|
337 |
|
338 |
/* Gradio plot component styling */
|
@@ -443,6 +549,32 @@ h1, h2, h3, p, .markdown {
|
|
443 |
background-color: #000000 !important;
|
444 |
padding: 20px !important;
|
445 |
margin-left: 300px !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
}
|
447 |
|
448 |
/* Failed tests display - seamless appearance with fixed height */
|
@@ -519,6 +651,24 @@ h1, h2, h3, p, .markdown {
|
|
519 |
background-color: #000000 !important;
|
520 |
}
|
521 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
|
523 |
|
524 |
/* JavaScript to reset scroll position */
|
@@ -543,6 +693,14 @@ with gr.Blocks(title="Model Test Results Dashboard", css=dark_theme_css) as demo
|
|
543 |
gr.Markdown("# π€ AI Models")
|
544 |
gr.Markdown("**Select a model to analyze test results**\n\n*Interactive dashboard with detailed metrics*")
|
545 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
546 |
# Model selection buttons in sidebar
|
547 |
model_buttons = []
|
548 |
for model_name in MODELS.keys():
|
@@ -556,50 +714,67 @@ with gr.Blocks(title="Model Test Results Dashboard", css=dark_theme_css) as demo
|
|
556 |
|
557 |
# Main content area
|
558 |
with gr.Column(scale=4, elem_classes=["main-content"]):
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
plot_output = gr.Plot(
|
563 |
label="",
|
564 |
format="png",
|
565 |
-
elem_classes=["plot-container"]
|
|
|
566 |
)
|
567 |
|
568 |
-
#
|
569 |
-
with gr.
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
588 |
|
589 |
# Set up click handlers for each button
|
590 |
for i, (model_name, button) in enumerate(zip(MODELS.keys(), model_buttons)):
|
591 |
button.click(
|
592 |
fn=lambda name=model_name: plot_model_stats(name),
|
593 |
outputs=[plot_output, amd_failed_tests_output, nvidia_failed_tests_output]
|
|
|
|
|
|
|
594 |
).then(
|
595 |
fn=None,
|
596 |
js="() => { setTimeout(() => { document.querySelectorAll('textarea').forEach(t => { if (t.closest('.failed-tests')) { t.scrollTop = 0; setTimeout(() => { t.style.scrollBehavior = 'smooth'; t.scrollTo({ top: 0, behavior: 'smooth' }); t.style.scrollBehavior = 'auto'; }, 50); } }); }, 300); }"
|
597 |
)
|
598 |
|
599 |
-
#
|
600 |
-
|
601 |
-
fn=lambda:
|
602 |
-
outputs=[
|
|
|
|
|
|
|
603 |
)
|
604 |
|
605 |
if __name__ == "__main__":
|
|
|
223 |
|
224 |
return total, success_rate, status_class
|
225 |
|
226 |
+
def create_summary_page() -> plt.Figure:
|
227 |
+
"""Create a summary page with model names and both AMD/NVIDIA test stats bars."""
|
228 |
+
fig, ax = plt.subplots(figsize=(12, len(MODELS) * 4 + 1), facecolor='#000000')
|
229 |
+
ax.set_facecolor('#000000')
|
230 |
+
|
231 |
+
colors = {
|
232 |
+
'passed': '#4CAF50',
|
233 |
+
'failed': '#E53E3E',
|
234 |
+
'skipped': '#FFD54F',
|
235 |
+
'error': '#8B0000'
|
236 |
+
}
|
237 |
+
|
238 |
+
for i, (model_name, model_data) in enumerate(MODELS.items()):
|
239 |
+
# Process AMD and NVIDIA data
|
240 |
+
amd_stats = {k: len(v) for k, v in model_data['amd'].items()}
|
241 |
+
amd_total = sum(amd_stats.values())
|
242 |
+
nvidia_stats = {k: len(v) for k, v in model_data['nvidia'].items()}
|
243 |
+
nvidia_total = sum(nvidia_stats.values())
|
244 |
+
|
245 |
+
if amd_total == 0 and nvidia_total == 0:
|
246 |
+
continue
|
247 |
+
|
248 |
+
# Position for this model - tighter spacing between groups
|
249 |
+
y_base = (len(MODELS) - i - 1) * 3.2
|
250 |
+
y_amd_text = y_base + 2.0 # AMD label
|
251 |
+
y_amd_bar = y_base + 1.5 # AMD bar
|
252 |
+
y_nvidia_text = y_base + 0.8 # NVIDIA label
|
253 |
+
y_nvidia_bar = y_base + 0.3 # NVIDIA bar
|
254 |
+
|
255 |
+
# AMD bar and label
|
256 |
+
if amd_total > 0:
|
257 |
+
ax.text(0, y_amd_text, f"{model_name.lower()} - AMD",
|
258 |
+
ha='left', va='center', color='#FFFFFF',
|
259 |
+
fontsize=24, fontfamily='monospace', fontweight='normal')
|
260 |
+
|
261 |
+
left = 0
|
262 |
+
for category in ['passed', 'failed', 'skipped', 'error']:
|
263 |
+
if amd_stats[category] > 0:
|
264 |
+
width = amd_stats[category] / amd_total * 100
|
265 |
+
ax.barh(y_amd_bar, width, left=left, height=0.45,
|
266 |
+
color=colors[category], alpha=0.9)
|
267 |
+
if width > 6:
|
268 |
+
ax.text(left + width/2, y_amd_bar, str(amd_stats[category]),
|
269 |
+
ha='center', va='center', color='black',
|
270 |
+
fontweight='bold', fontsize=10, fontfamily='monospace')
|
271 |
+
left += width
|
272 |
+
|
273 |
+
# NVIDIA bar and label
|
274 |
+
if nvidia_total > 0:
|
275 |
+
ax.text(0, y_nvidia_text, f"{model_name.lower()} - NVIDIA",
|
276 |
+
ha='left', va='center', color='#FFFFFF',
|
277 |
+
fontsize=24, fontfamily='monospace', fontweight='normal')
|
278 |
+
|
279 |
+
left = 0
|
280 |
+
for category in ['passed', 'failed', 'skipped', 'error']:
|
281 |
+
if nvidia_stats[category] > 0:
|
282 |
+
width = nvidia_stats[category] / nvidia_total * 100
|
283 |
+
ax.barh(y_nvidia_bar, width, left=left, height=0.45,
|
284 |
+
color=colors[category], alpha=0.9)
|
285 |
+
if width > 6:
|
286 |
+
ax.text(left + width/2, y_nvidia_bar, str(nvidia_stats[category]),
|
287 |
+
ha='center', va='center', color='black',
|
288 |
+
fontweight='bold', fontsize=10, fontfamily='monospace')
|
289 |
+
left += width
|
290 |
+
|
291 |
+
# Style the axes to be completely invisible and span full width
|
292 |
+
ax.set_xlim(0, 100)
|
293 |
+
ax.set_ylim(-1, len(MODELS) * 3.2)
|
294 |
+
ax.set_xlabel('')
|
295 |
+
ax.set_ylabel('')
|
296 |
+
ax.spines['bottom'].set_visible(False)
|
297 |
+
ax.spines['left'].set_visible(False)
|
298 |
+
ax.spines['top'].set_visible(False)
|
299 |
+
ax.spines['right'].set_visible(False)
|
300 |
+
ax.set_xticks([])
|
301 |
+
ax.set_yticks([])
|
302 |
+
|
303 |
+
# Remove all margins to make bars span full width
|
304 |
+
plt.tight_layout()
|
305 |
+
plt.subplots_adjust(left=0.02, right=0.98, top=0.98, bottom=0.02)
|
306 |
+
|
307 |
+
return fig
|
308 |
+
|
309 |
# Custom CSS for dark theme
|
310 |
dark_theme_css = """
|
311 |
/* Global dark theme */
|
|
|
411 |
border-color: #666666 !important;
|
412 |
}
|
413 |
|
414 |
+
/* Plot container with smooth transitions and controlled scrolling */
|
415 |
.plot-container {
|
416 |
background-color: #000000 !important;
|
417 |
border: none !important;
|
418 |
transition: opacity 0.6s ease-in-out !important;
|
419 |
+
max-height: 70vh !important;
|
420 |
+
overflow-y: auto !important;
|
421 |
+
scrollbar-width: thin !important;
|
422 |
+
scrollbar-color: #333333 #000000 !important;
|
423 |
+
}
|
424 |
+
|
425 |
+
/* Custom scrollbar for plot container */
|
426 |
+
.plot-container::-webkit-scrollbar {
|
427 |
+
width: 8px !important;
|
428 |
+
background: #000000 !important;
|
429 |
+
}
|
430 |
+
|
431 |
+
.plot-container::-webkit-scrollbar-track {
|
432 |
+
background: #000000 !important;
|
433 |
+
}
|
434 |
+
|
435 |
+
.plot-container::-webkit-scrollbar-thumb {
|
436 |
+
background-color: #333333 !important;
|
437 |
+
border-radius: 4px !important;
|
438 |
+
}
|
439 |
+
|
440 |
+
.plot-container::-webkit-scrollbar-thumb:hover {
|
441 |
+
background-color: #555555 !important;
|
442 |
}
|
443 |
|
444 |
/* Gradio plot component styling */
|
|
|
549 |
background-color: #000000 !important;
|
550 |
padding: 20px !important;
|
551 |
margin-left: 300px !important;
|
552 |
+
height: 100vh !important;
|
553 |
+
overflow: hidden !important;
|
554 |
+
}
|
555 |
+
|
556 |
+
/* Custom scrollbar for main content */
|
557 |
+
.main-content {
|
558 |
+
scrollbar-width: thin !important;
|
559 |
+
scrollbar-color: #333333 #000000 !important;
|
560 |
+
}
|
561 |
+
|
562 |
+
.main-content::-webkit-scrollbar {
|
563 |
+
width: 8px !important;
|
564 |
+
background: #000000 !important;
|
565 |
+
}
|
566 |
+
|
567 |
+
.main-content::-webkit-scrollbar-track {
|
568 |
+
background: #000000 !important;
|
569 |
+
}
|
570 |
+
|
571 |
+
.main-content::-webkit-scrollbar-thumb {
|
572 |
+
background-color: #333333 !important;
|
573 |
+
border-radius: 4px !important;
|
574 |
+
}
|
575 |
+
|
576 |
+
.main-content::-webkit-scrollbar-thumb:hover {
|
577 |
+
background-color: #555555 !important;
|
578 |
}
|
579 |
|
580 |
/* Failed tests display - seamless appearance with fixed height */
|
|
|
651 |
background-color: #000000 !important;
|
652 |
}
|
653 |
|
654 |
+
/* Summary display styling */
|
655 |
+
.summary-display textarea {
|
656 |
+
background-color: #000000 !important;
|
657 |
+
color: #FFFFFF !important;
|
658 |
+
font-family: monospace !important;
|
659 |
+
font-size: 24px !important;
|
660 |
+
border: none !important;
|
661 |
+
padding: 20px !important;
|
662 |
+
outline: none !important;
|
663 |
+
line-height: 2 !important;
|
664 |
+
text-align: right !important;
|
665 |
+
resize: none !important;
|
666 |
+
}
|
667 |
+
|
668 |
+
.summary-display {
|
669 |
+
background-color: #000000 !important;
|
670 |
+
}
|
671 |
+
|
672 |
|
673 |
|
674 |
/* JavaScript to reset scroll position */
|
|
|
693 |
gr.Markdown("# π€ AI Models")
|
694 |
gr.Markdown("**Select a model to analyze test results**\n\n*Interactive dashboard with detailed metrics*")
|
695 |
|
696 |
+
# Summary button at the top
|
697 |
+
summary_button = gr.Button(
|
698 |
+
"summary",
|
699 |
+
variant="primary",
|
700 |
+
size="lg",
|
701 |
+
elem_classes=["model-button"]
|
702 |
+
)
|
703 |
+
|
704 |
# Model selection buttons in sidebar
|
705 |
model_buttons = []
|
706 |
for model_name in MODELS.keys():
|
|
|
714 |
|
715 |
# Main content area
|
716 |
with gr.Column(scale=4, elem_classes=["main-content"]):
|
717 |
+
# Summary display (default view)
|
718 |
+
summary_display = gr.Plot(
|
719 |
+
value=create_summary_page(),
|
|
|
720 |
label="",
|
721 |
format="png",
|
722 |
+
elem_classes=["plot-container"],
|
723 |
+
visible=True
|
724 |
)
|
725 |
|
726 |
+
# Detailed view components (hidden by default)
|
727 |
+
with gr.Column(visible=False, elem_classes=["detail-view"]) as detail_view:
|
728 |
+
gr.Markdown("# π Test Results Dashboard")
|
729 |
+
|
730 |
+
# Create the plot output
|
731 |
+
plot_output = gr.Plot(
|
732 |
+
label="",
|
733 |
+
format="png",
|
734 |
+
elem_classes=["plot-container"]
|
735 |
+
)
|
736 |
+
|
737 |
+
# Create two separate failed tests displays in a row layout
|
738 |
+
with gr.Row():
|
739 |
+
with gr.Column(scale=1):
|
740 |
+
amd_failed_tests_output = gr.Textbox(
|
741 |
+
value="Failures on AMD (exclusive):\nβββββββββββββββββββββββββββββ\nnetwork_timeout\n\nFailures on AMD (common):\nββββββββββββββββββββββββ\ndistributed",
|
742 |
+
lines=8,
|
743 |
+
max_lines=8,
|
744 |
+
interactive=False,
|
745 |
+
container=False,
|
746 |
+
elem_classes=["failed-tests"]
|
747 |
+
)
|
748 |
+
with gr.Column(scale=1):
|
749 |
+
nvidia_failed_tests_output = gr.Textbox(
|
750 |
+
value="Failures on NVIDIA (exclusive):\nβββββββββββββββββββββββββββββββββ\nmulti_gpu\n\nFailures on NVIDIA (common):\nββββββββββββββββββββββββββββ\ndistributed",
|
751 |
+
lines=8,
|
752 |
+
max_lines=8,
|
753 |
+
interactive=False,
|
754 |
+
container=False,
|
755 |
+
elem_classes=["failed-tests"]
|
756 |
+
)
|
757 |
|
758 |
# Set up click handlers for each button
|
759 |
for i, (model_name, button) in enumerate(zip(MODELS.keys(), model_buttons)):
|
760 |
button.click(
|
761 |
fn=lambda name=model_name: plot_model_stats(name),
|
762 |
outputs=[plot_output, amd_failed_tests_output, nvidia_failed_tests_output]
|
763 |
+
).then(
|
764 |
+
fn=lambda: [gr.update(visible=False), gr.update(visible=True)],
|
765 |
+
outputs=[summary_display, detail_view]
|
766 |
).then(
|
767 |
fn=None,
|
768 |
js="() => { setTimeout(() => { document.querySelectorAll('textarea').forEach(t => { if (t.closest('.failed-tests')) { t.scrollTop = 0; setTimeout(() => { t.style.scrollBehavior = 'smooth'; t.scrollTo({ top: 0, behavior: 'smooth' }); t.style.scrollBehavior = 'auto'; }, 50); } }); }, 300); }"
|
769 |
)
|
770 |
|
771 |
+
# Summary button click handler
|
772 |
+
summary_button.click(
|
773 |
+
fn=lambda: create_summary_page(),
|
774 |
+
outputs=[summary_display]
|
775 |
+
).then(
|
776 |
+
fn=lambda: [gr.update(visible=True), gr.update(visible=False)],
|
777 |
+
outputs=[summary_display, detail_view]
|
778 |
)
|
779 |
|
780 |
if __name__ == "__main__":
|