Spaces:
Running
Running
Fix model page for unfound data
Browse files- app.py +13 -14
- data.py +6 -2
- model_page.py +4 -2
app.py
CHANGED
@@ -35,21 +35,19 @@ def model_has_failures(model_name):
|
|
35 |
# Check if model exists in DataFrame
|
36 |
if model_name_lower not in Ci_results.df.index:
|
37 |
return False
|
|
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
except Exception:
|
52 |
-
return False
|
53 |
|
54 |
|
55 |
# Function to get current description text
|
@@ -110,6 +108,7 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css()) as demo:
|
|
110 |
for model_name in model_choices:
|
111 |
# Check if model has failures to determine styling
|
112 |
has_failures = model_has_failures(model_name)
|
|
|
113 |
button_classes = ["model-button"]
|
114 |
if has_failures:
|
115 |
button_classes.append("model-button-failed")
|
|
|
35 |
# Check if model exists in DataFrame
|
36 |
if model_name_lower not in Ci_results.df.index:
|
37 |
return False
|
38 |
+
row = Ci_results.df.loc[model_name_lower]
|
39 |
|
40 |
+
# Check for failures in both AMD and NVIDIA
|
41 |
+
amd_multi_failures = row.get('failed_multi_no_amd', 0)
|
42 |
+
amd_single_failures = row.get('failed_single_no_amd', 0)
|
43 |
+
nvidia_multi_failures = row.get('failed_multi_no_nvidia', 0)
|
44 |
+
nvidia_single_failures = row.get('failed_single_no_nvidia', 0)
|
45 |
+
return any([
|
46 |
+
amd_multi_failures > 0,
|
47 |
+
amd_single_failures > 0,
|
48 |
+
nvidia_multi_failures > 0,
|
49 |
+
nvidia_single_failures > 0,
|
50 |
+
])
|
|
|
|
|
|
|
51 |
|
52 |
|
53 |
# Function to get current description text
|
|
|
108 |
for model_name in model_choices:
|
109 |
# Check if model has failures to determine styling
|
110 |
has_failures = model_has_failures(model_name)
|
111 |
+
# print(f"{model_name = }, {has_failures = }")
|
112 |
button_classes = ["model-button"]
|
113 |
if has_failures:
|
114 |
button_classes.append("model-button-failed")
|
data.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
from huggingface_hub import HfFileSystem
|
2 |
import pandas as pd
|
3 |
from utils import logger
|
4 |
-
import os
|
5 |
from datetime import datetime
|
6 |
import threading
|
7 |
import traceback
|
8 |
import json
|
9 |
|
10 |
-
|
|
|
11 |
|
12 |
IMPORTANT_MODELS = [
|
13 |
"auto",
|
@@ -76,6 +76,10 @@ def get_distant_data() -> pd.DataFrame:
|
|
76 |
# Fitler out all but important models
|
77 |
important_models_lower = [model.lower() for model in IMPORTANT_MODELS]
|
78 |
filtered_joined = joined[joined.index.str.lower().isin(important_models_lower)]
|
|
|
|
|
|
|
|
|
79 |
return filtered_joined
|
80 |
|
81 |
|
|
|
1 |
from huggingface_hub import HfFileSystem
|
2 |
import pandas as pd
|
3 |
from utils import logger
|
|
|
4 |
from datetime import datetime
|
5 |
import threading
|
6 |
import traceback
|
7 |
import json
|
8 |
|
9 |
+
# NOTE: if caching is an issue, try adding `use_listings_cache=False`
|
10 |
+
fs = HfFileSystem()
|
11 |
|
12 |
IMPORTANT_MODELS = [
|
13 |
"auto",
|
|
|
76 |
# Fitler out all but important models
|
77 |
important_models_lower = [model.lower() for model in IMPORTANT_MODELS]
|
78 |
filtered_joined = joined[joined.index.str.lower().isin(important_models_lower)]
|
79 |
+
# Warn for ach missing important models
|
80 |
+
for model in IMPORTANT_MODELS:
|
81 |
+
if model not in filtered_joined.index:
|
82 |
+
print(f"[WARNING] Model {model} was missing from index.")
|
83 |
return filtered_joined
|
84 |
|
85 |
|
model_page.py
CHANGED
@@ -104,8 +104,10 @@ def plot_model_stats(df: pd.DataFrame, model_name: str) -> tuple[plt.Figure, str
|
|
104 |
nvidia_filtered = {k: v for k, v in nvidia_stats.items() if v > 0}
|
105 |
|
106 |
# Generate failure info directly from dataframe
|
107 |
-
failures_amd =
|
108 |
-
|
|
|
|
|
109 |
|
110 |
# failure_xxx = {"single": [test, ...], "multi": [...]}
|
111 |
# test = {"line": test_name. "trace": error_msg}
|
|
|
104 |
nvidia_filtered = {k: v for k, v in nvidia_stats.items() if v > 0}
|
105 |
|
106 |
# Generate failure info directly from dataframe
|
107 |
+
failures_amd = row.get('failures_amd', None)
|
108 |
+
failures_amd = {} if (failures_amd is None or pd.isna(failures_amd)) else dict(failures_amd)
|
109 |
+
failures_nvidia = row.get('failures_nvidia')
|
110 |
+
failures_nvidia = {} if (failures_nvidia is None or pd.isna(failures_nvidia)) else dict(failures_nvidia)
|
111 |
|
112 |
# failure_xxx = {"single": [test, ...], "multi": [...]}
|
113 |
# test = {"line": test_name. "trace": error_msg}
|