badaoui HF Staff commited on
Commit
4dbe4aa
·
1 Parent(s): db0aaba

show only failing models feature

Browse files
Files changed (2) hide show
  1. app.py +38 -1
  2. styles.css +36 -0
app.py CHANGED
@@ -99,6 +99,30 @@ function refresh() {
99
  window.location.href = url.href;
100
  }
101
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  """
103
 
104
  # Create the Gradio interface with sidebar and dark theme
@@ -128,6 +152,14 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css(), js=js_func)
128
  interactive=True,
129
  elem_classes=["history-view-button"]
130
  )
 
 
 
 
 
 
 
 
131
 
132
 
133
  # Model selection header (clickable toggle)
@@ -151,12 +183,17 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css(), js=js_func)
151
  button_classes = ["model-button"]
152
  if has_failures:
153
  button_classes.append("model-button-failed")
 
 
 
 
154
 
155
  btn = gr.Button(
156
  model_name,
157
  variant="secondary",
158
  size="sm",
159
- elem_classes=button_classes
 
160
  )
161
  model_buttons.append(btn)
162
 
 
99
  window.location.href = url.href;
100
  }
101
  }
102
+
103
+ // Handle "Show only failing models" toggle
104
+ function setupFailingModelsFilter() {
105
+ // Wait for DOM to be ready
106
+ setTimeout(() => {
107
+ const checkbox = document.querySelector('.failing-models-toggle input[type="checkbox"]');
108
+ if (checkbox) {
109
+ checkbox.addEventListener('change', (e) => {
110
+ const showOnlyFailing = e.target.checked;
111
+ const passingModels = document.querySelectorAll('.model-button.no-failures');
112
+
113
+ passingModels.forEach(btn => {
114
+ if (showOnlyFailing) {
115
+ btn.style.display = 'none';
116
+ } else {
117
+ btn.style.display = 'block';
118
+ }
119
+ });
120
+ });
121
+ }
122
+ }, 500);
123
+ }
124
+
125
+ setupFailingModelsFilter();
126
  """
127
 
128
  # Create the Gradio interface with sidebar and dark theme
 
152
  interactive=True,
153
  elem_classes=["history-view-button"]
154
  )
155
+
156
+ # Toggle to show only failing models
157
+ show_only_failing = gr.Checkbox(
158
+ label="Show only failing models",
159
+ value=False,
160
+ interactive=True,
161
+ elem_classes=["failing-models-toggle"]
162
+ )
163
 
164
 
165
  # Model selection header (clickable toggle)
 
183
  button_classes = ["model-button"]
184
  if has_failures:
185
  button_classes.append("model-button-failed")
186
+ button_classes.append("has-failures")
187
+ else:
188
+ button_classes.append("model-button-passing")
189
+ button_classes.append("no-failures")
190
 
191
  btn = gr.Button(
192
  model_name,
193
  variant="secondary",
194
  size="sm",
195
+ elem_classes=button_classes,
196
+ elem_id=f"model-btn-{model_name}"
197
  )
198
  model_buttons.append(btn)
199
 
styles.css CHANGED
@@ -194,6 +194,42 @@ div[data-testid="column"]:has(.sidebar) {
194
  transition: all 0.3s ease !important;
195
  }
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
 
198
  /* Model button styling */
199
  .model-button {
 
194
  transition: all 0.3s ease !important;
195
  }
196
 
197
+ /* Failing models toggle styling */
198
+ .failing-models-toggle {
199
+ background: linear-gradient(145deg, #1a1a1a, #0f0f0f) !important;
200
+ border: 1px solid #333 !important;
201
+ border-radius: 6px !important;
202
+ padding: 10px 12px !important;
203
+ margin: 8px 0px 15px 0px !important;
204
+ transition: all 0.3s ease !important;
205
+ }
206
+
207
+ .failing-models-toggle:hover {
208
+ background: linear-gradient(145deg, #252525, #1a1a1a) !important;
209
+ border-color: #444 !important;
210
+ }
211
+
212
+ .failing-models-toggle label {
213
+ color: #E53E3E !important;
214
+ font-family: monospace !important;
215
+ font-size: 13px !important;
216
+ font-weight: 600 !important;
217
+ text-transform: uppercase !important;
218
+ letter-spacing: 0.5px !important;
219
+ cursor: pointer !important;
220
+ }
221
+
222
+ .failing-models-toggle input[type="checkbox"] {
223
+ accent-color: #E53E3E !important;
224
+ cursor: pointer !important;
225
+ width: 18px !important;
226
+ height: 18px !important;
227
+ }
228
+
229
+ .failing-models-toggle input[type="checkbox"]:checked {
230
+ accent-color: #FF6B6B !important;
231
+ }
232
+
233
 
234
  /* Model button styling */
235
  .model-button {