one fucntion for has_failures
Browse files
app.py
CHANGED
|
@@ -35,58 +35,25 @@ Ci_results.schedule_data_reload()
|
|
| 35 |
|
| 36 |
|
| 37 |
# Function to check if a model has failures
|
| 38 |
-
def
|
| 39 |
-
"""Check if a model has any failures (AMD or NVIDIA)."""
|
| 40 |
if Ci_results.df is None or Ci_results.df.empty:
|
| 41 |
return False
|
| 42 |
|
| 43 |
-
# Normalize model name to match DataFrame index
|
| 44 |
model_name_lower = model_name.lower()
|
| 45 |
-
|
| 46 |
-
# Check if model exists in DataFrame
|
| 47 |
if model_name_lower not in Ci_results.df.index:
|
| 48 |
return False
|
| 49 |
-
row = Ci_results.df.loc[model_name_lower]
|
| 50 |
-
|
| 51 |
-
# Check for failures in both AMD and NVIDIA
|
| 52 |
-
amd_multi_failures = row.get('failed_multi_no_amd', 0)
|
| 53 |
-
amd_single_failures = row.get('failed_single_no_amd', 0)
|
| 54 |
-
nvidia_multi_failures = row.get('failed_multi_no_nvidia', 0)
|
| 55 |
-
nvidia_single_failures = row.get('failed_single_no_nvidia', 0)
|
| 56 |
-
return any([
|
| 57 |
-
amd_multi_failures > 0,
|
| 58 |
-
amd_single_failures > 0,
|
| 59 |
-
nvidia_multi_failures > 0,
|
| 60 |
-
nvidia_single_failures > 0,
|
| 61 |
-
])
|
| 62 |
-
|
| 63 |
-
def model_has_amd_failures(model_name):
|
| 64 |
-
"""Check if a model has AMD failures."""
|
| 65 |
-
if Ci_results.df is None or Ci_results.df.empty:
|
| 66 |
-
return False
|
| 67 |
|
| 68 |
-
model_name_lower = model_name.lower()
|
| 69 |
-
if model_name_lower not in Ci_results.df.index:
|
| 70 |
-
return False
|
| 71 |
row = Ci_results.df.loc[model_name_lower]
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
def model_has_nvidia_failures(model_name):
|
| 78 |
-
"""Check if a model has NVIDIA failures."""
|
| 79 |
-
if Ci_results.df is None or Ci_results.df.empty:
|
| 80 |
-
return False
|
| 81 |
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
row = Ci_results.df.loc[model_name_lower]
|
| 86 |
|
| 87 |
-
|
| 88 |
-
nvidia_single_failures = row.get('failed_single_no_nvidia', 0)
|
| 89 |
-
return nvidia_multi_failures > 0 or nvidia_single_failures > 0
|
| 90 |
|
| 91 |
|
| 92 |
# Function to get current description text
|
|
@@ -232,8 +199,8 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css(), js=js_func)
|
|
| 232 |
print(f"Creating {len(model_choices)} model buttons: {model_choices}")
|
| 233 |
|
| 234 |
for model_name in model_choices:
|
| 235 |
-
has_amd =
|
| 236 |
-
has_nvidia =
|
| 237 |
|
| 238 |
if has_amd and has_nvidia:
|
| 239 |
both_failing_models.append(model_name)
|
|
@@ -247,7 +214,7 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css(), js=js_func)
|
|
| 247 |
# Container for all models (visible by default)
|
| 248 |
with gr.Column(visible=True, elem_classes=["all-models-container"]) as all_models_container:
|
| 249 |
for model_name in model_choices:
|
| 250 |
-
has_failures =
|
| 251 |
button_classes = ["model-button"]
|
| 252 |
if has_failures:
|
| 253 |
button_classes.append("model-button-failed")
|
|
|
|
| 35 |
|
| 36 |
|
| 37 |
# Function to check if a model has failures
|
| 38 |
+
def model_has_failures_by_device(model_name, device='both'):
|
|
|
|
| 39 |
if Ci_results.df is None or Ci_results.df.empty:
|
| 40 |
return False
|
| 41 |
|
|
|
|
| 42 |
model_name_lower = model_name.lower()
|
|
|
|
|
|
|
| 43 |
if model_name_lower not in Ci_results.df.index:
|
| 44 |
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
|
|
|
|
|
|
|
|
|
| 46 |
row = Ci_results.df.loc[model_name_lower]
|
| 47 |
|
| 48 |
+
if device in ('amd', 'both'):
|
| 49 |
+
if row.get('failed_multi_no_amd', 0) > 0 or row.get('failed_single_no_amd', 0) > 0:
|
| 50 |
+
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
+
if device in ('nvidia', 'both'):
|
| 53 |
+
if row.get('failed_multi_no_nvidia', 0) > 0 or row.get('failed_single_no_nvidia', 0) > 0:
|
| 54 |
+
return True
|
|
|
|
| 55 |
|
| 56 |
+
return False
|
|
|
|
|
|
|
| 57 |
|
| 58 |
|
| 59 |
# Function to get current description text
|
|
|
|
| 199 |
print(f"Creating {len(model_choices)} model buttons: {model_choices}")
|
| 200 |
|
| 201 |
for model_name in model_choices:
|
| 202 |
+
has_amd = model_has_failures_by_device(model_name, 'amd')
|
| 203 |
+
has_nvidia = model_has_failures_by_device(model_name, 'nvidia')
|
| 204 |
|
| 205 |
if has_amd and has_nvidia:
|
| 206 |
both_failing_models.append(model_name)
|
|
|
|
| 214 |
# Container for all models (visible by default)
|
| 215 |
with gr.Column(visible=True, elem_classes=["all-models-container"]) as all_models_container:
|
| 216 |
for model_name in model_choices:
|
| 217 |
+
has_failures = model_has_failures_by_device(model_name, 'both')
|
| 218 |
button_classes = ["model-button"]
|
| 219 |
if has_failures:
|
| 220 |
button_classes.append("model-button-failed")
|