juancauma commited on
Commit
4cde644
·
1 Parent(s): c6dea61

changes to font color

Browse files
Files changed (2) hide show
  1. app.py +96 -1
  2. styles.css +38 -3
app.py CHANGED
@@ -60,6 +60,34 @@ custom_css += """
60
  }
61
  """
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  def strip_timestamp(name):
64
  """Remove the timestamp portion from the model name."""
65
  parts = name.split('-')
@@ -354,7 +382,7 @@ def update_leaderboard(selected_mwoz, selected_tau_airline, selected_tau_retail,
354
  # Create our custom theme instance
355
  custom_theme = CustomTheme()
356
 
357
- with gr.Blocks(css=custom_css, title="TD-EVAL Leaderboard", theme=custom_theme) as demo:
358
  gr.Markdown("# 🏆 TD-EVAL Model Evaluation Leaderboard")
359
  gr.HTML('<div class="subtitle">This leaderboard displays aggregated model performance across multiple evaluation metrics.</div>')
360
 
@@ -582,5 +610,72 @@ with gr.Blocks(css=custom_css, title="TD-EVAL Leaderboard", theme=custom_theme)
582
 
583
  demo.load(fn=update_leaderboard, inputs=[cb_mwoz, cb_tau_airline, cb_tau_retail, hidden_sort_state, search_input], outputs=leaderboard_display)
584
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
585
  if __name__ == "__main__":
 
586
  demo.launch()
 
60
  }
61
  """
62
 
63
+ # CSS for the page
64
+ css = """
65
+ /* Additional style to ensure text color in textareas is black */
66
+ textarea, input, textarea[data-testid="textbox"] {
67
+ color: #000000 !important;
68
+ }
69
+
70
+ /* Fix for block labels in gradio */
71
+ span[data-testid="block-info"] {
72
+ color: #000000 !important;
73
+ background-color: transparent !important;
74
+ }
75
+
76
+ /* Additional style to ensure text color in textareas and inputs is black */
77
+ textarea, input, textarea[data-testid="textbox"] {
78
+ color: #000000 !important;
79
+ }
80
+
81
+ /* Force black text color for search textbox */
82
+ .search-panel textarea,
83
+ textarea.scroll-hide,
84
+ textarea.svelte-173056l,
85
+ textarea[data-testid="textbox"] {
86
+ color: #000000 !important;
87
+ caret-color: #000000 !important;
88
+ }
89
+ """
90
+
91
  def strip_timestamp(name):
92
  """Remove the timestamp portion from the model name."""
93
  parts = name.split('-')
 
382
  # Create our custom theme instance
383
  custom_theme = CustomTheme()
384
 
385
+ with gr.Blocks(css=css, title="TD-EVAL Leaderboard", theme=custom_theme) as demo:
386
  gr.Markdown("# 🏆 TD-EVAL Model Evaluation Leaderboard")
387
  gr.HTML('<div class="subtitle">This leaderboard displays aggregated model performance across multiple evaluation metrics.</div>')
388
 
 
610
 
611
  demo.load(fn=update_leaderboard, inputs=[cb_mwoz, cb_tau_airline, cb_tau_retail, hidden_sort_state, search_input], outputs=leaderboard_display)
612
 
613
+ # JavaScript to change panel backgrounds
614
+ searchpanel_js = """
615
+ function applyStyles() {
616
+ // Add a style tag to the head to ensure textarea text color
617
+ var styleElement = document.createElement('style');
618
+ styleElement.textContent = `
619
+ textarea,
620
+ textarea[data-testid="textbox"],
621
+ textarea.scroll-hide,
622
+ textarea.svelte-173056l {
623
+ color: #000000 !important;
624
+ caret-color: #000000 !important;
625
+ }
626
+ `;
627
+ document.head.appendChild(styleElement);
628
+
629
+ // Wait for the DOM to be fully loaded
630
+ var searchPanel = document.querySelector('.search-panel');
631
+ if (searchPanel) {
632
+ searchPanel.style.backgroundColor = '#F0F0F0';
633
+ searchPanel.style.padding = '10px';
634
+ searchPanel.style.borderRadius = '8px';
635
+ searchPanel.style.marginBottom = '20px';
636
+
637
+ // Target input elements in search panel
638
+ var searchInput = searchPanel.querySelector('input[type="text"]');
639
+ if (searchInput) {
640
+ var parent = searchInput.parentElement;
641
+ if (parent) parent.style.backgroundColor = 'transparent';
642
+ searchInput.style.backgroundColor = '#FFFFFF';
643
+ // Ensure the border is visible and matches text color
644
+ searchInput.style.border = '2px solid #000000';
645
+ searchInput.style.color = '#000000';
646
+ }
647
+
648
+ // Also target textarea elements which are often used for input
649
+ var searchTextarea = searchPanel.querySelector('textarea[data-testid="textbox"]');
650
+ if (searchTextarea) {
651
+ var parent = searchTextarea.parentElement;
652
+ if (parent) parent.style.backgroundColor = 'transparent';
653
+ searchTextarea.style.backgroundColor = '#FFFFFF';
654
+ searchTextarea.style.border = '2px solid #000000';
655
+ searchTextarea.style.color = '#000000';
656
+
657
+ // Force the color to remain black through inline style with !important
658
+ searchTextarea.setAttribute('style', 'color: #000000 !important; background-color: #FFFFFF !important; border: 2px solid #000000 !important;');
659
+ }
660
+
661
+ // Make any span labels black for readability
662
+ var spans = searchPanel.querySelectorAll('span');
663
+ spans.forEach(function(span) {
664
+ span.style.color = '#000000';
665
+ });
666
+ }
667
+
668
+ // ... rest of the function remains the same ...
669
+ }
670
+
671
+ // Call the function when page loads
672
+ document.addEventListener('DOMContentLoaded', applyStyles);
673
+ // Also call it after a short delay to catch elements that might load later
674
+ setTimeout(applyStyles, 500);
675
+ // And set an interval to catch any dynamically loaded elements
676
+ setInterval(applyStyles, 2000);
677
+ """
678
+
679
  if __name__ == "__main__":
680
+ demo.load(js=searchpanel_js)
681
  demo.launch()
styles.css CHANGED
@@ -194,6 +194,19 @@ input[type="text"]:focus {
194
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
195
  }
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  /* ------------------------------------------------------------------
198
  No‐results Message
199
  ------------------------------------------------------------------ */
@@ -262,7 +275,8 @@ div[class*="block"] {
262
  }
263
 
264
  /* Make the textbox border visible with the same color as the text */
265
- .search-panel input[type="text"] {
 
266
  border: 2px solid #000000 !important;
267
  background-color: #FFFFFF !important;
268
  color: #000000 !important;
@@ -270,7 +284,9 @@ div[class*="block"] {
270
 
271
  /* Ensure input text and placeholder have consistent styling */
272
  .search-panel input[type="text"],
273
- .search-panel input[type="text"]::placeholder {
 
 
274
  color: rgba(0,0,0,0.7) !important;
275
  }
276
 
@@ -291,7 +307,10 @@ div[id="search-panel"] label,
291
  /* Make sure the input text is black when user types */
292
  #search-panel input[type="text"],
293
  div[id="search-panel"] input[type="text"],
294
- .search-panel input[type="text"] {
 
 
 
295
  color: #000000 !important;
296
  }
297
 
@@ -330,4 +349,20 @@ span.svelte-1gfkn6j,
330
  #search-panel span,
331
  div[id="search-panel"] span {
332
  color: #000000 !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  }
 
194
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
195
  }
196
 
197
+ /* Target the textarea used for search input */
198
+ textarea[data-testid="textbox"],
199
+ .scroll-hide,
200
+ .svelte-173056l {
201
+ color: #000000 !important;
202
+ background-color: #FFFFFF !important;
203
+ }
204
+
205
+ /* Apply the style when typing and focused */
206
+ textarea[data-testid="textbox"]:focus {
207
+ color: #000000 !important;
208
+ }
209
+
210
  /* ------------------------------------------------------------------
211
  No‐results Message
212
  ------------------------------------------------------------------ */
 
275
  }
276
 
277
  /* Make the textbox border visible with the same color as the text */
278
+ .search-panel input[type="text"],
279
+ .search-panel textarea[data-testid="textbox"] {
280
  border: 2px solid #000000 !important;
281
  background-color: #FFFFFF !important;
282
  color: #000000 !important;
 
284
 
285
  /* Ensure input text and placeholder have consistent styling */
286
  .search-panel input[type="text"],
287
+ .search-panel input[type="text"]::placeholder,
288
+ .search-panel textarea[data-testid="textbox"],
289
+ .search-panel textarea[data-testid="textbox"]::placeholder {
290
  color: rgba(0,0,0,0.7) !important;
291
  }
292
 
 
307
  /* Make sure the input text is black when user types */
308
  #search-panel input[type="text"],
309
  div[id="search-panel"] input[type="text"],
310
+ .search-panel input[type="text"],
311
+ #search-panel textarea,
312
+ div[id="search-panel"] textarea,
313
+ .search-panel textarea {
314
  color: #000000 !important;
315
  }
316
 
 
349
  #search-panel span,
350
  div[id="search-panel"] span {
351
  color: #000000 !important;
352
+ }
353
+
354
+ /* Target the specific search input by ID */
355
+ #search-input,
356
+ #search-input label,
357
+ #search-input span,
358
+ [id="search-input"] + div label,
359
+ [id="search-input"] ~ div span,
360
+ [id="search-input"] + label {
361
+ color: #000000 !important;
362
+ }
363
+
364
+ /* Ultra-specific selector targeting the label span */
365
+ div[id="search-panel"] span[data-testid="block-info"] {
366
+ color: #000000 !important;
367
+ font-weight: bold !important;
368
  }