Update app.py
Browse files
app.py
CHANGED
@@ -50,21 +50,22 @@ if not benchmarks or len(benchmarks) == 0:
|
|
50 |
else:
|
51 |
print(f"Found {len(benchmarks)} existing benchmarks.")
|
52 |
|
53 |
-
# Custom CSS with
|
54 |
css = """
|
55 |
-
/*
|
56 |
-
.gradio-container {
|
57 |
-
color: #333333 !important;
|
58 |
-
}
|
59 |
-
|
60 |
-
/* Fix for info boxes */
|
61 |
.info-text {
|
62 |
-
background-color:
|
63 |
padding: 12px;
|
64 |
border-radius: 8px;
|
65 |
border-left: 4px solid #3498db;
|
66 |
margin: 12px 0;
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
|
70 |
/* Container styling */
|
@@ -77,7 +78,8 @@ css = """
|
|
77 |
.header {
|
78 |
text-align: center;
|
79 |
margin-bottom: 20px;
|
80 |
-
|
|
|
81 |
}
|
82 |
|
83 |
/* Footer styling */
|
@@ -85,49 +87,52 @@ css = """
|
|
85 |
text-align: center;
|
86 |
margin-top: 40px;
|
87 |
padding: 20px;
|
88 |
-
border-top: 1px solid #eee;
|
89 |
-
color: #222222 !important;
|
90 |
}
|
91 |
|
92 |
-
/*
|
93 |
-
|
94 |
-
color:
|
|
|
95 |
}
|
96 |
|
97 |
-
/*
|
98 |
-
.
|
99 |
-
|
100 |
-
color:
|
101 |
}
|
102 |
|
103 |
-
/*
|
104 |
-
|
105 |
-
color:
|
|
|
106 |
}
|
107 |
|
108 |
-
/*
|
109 |
-
|
110 |
-
color:
|
111 |
}
|
112 |
|
113 |
-
/*
|
114 |
-
|
115 |
-
color:
|
116 |
}
|
117 |
|
118 |
-
/*
|
119 |
-
|
120 |
-
color:
|
121 |
}
|
122 |
|
123 |
-
/*
|
124 |
-
|
125 |
-
color:
|
126 |
}
|
127 |
|
128 |
-
/*
|
129 |
-
|
130 |
-
|
|
|
|
|
131 |
}
|
132 |
"""
|
133 |
|
@@ -142,7 +147,7 @@ def start_queue_worker():
|
|
142 |
print(f"Error starting queue worker: {e}")
|
143 |
|
144 |
# Create Gradio app
|
145 |
-
with gr.Blocks(css=css, title="Dynamic Highscores") as app:
|
146 |
gr.Markdown("# 🏆 Dynamic Highscores", elem_classes=["header"])
|
147 |
gr.Markdown("""
|
148 |
Welcome to Dynamic Highscores - a community benchmark platform for evaluating and comparing language models.
|
|
|
50 |
else:
|
51 |
print(f"Found {len(benchmarks)} existing benchmarks.")
|
52 |
|
53 |
+
# Custom CSS with better theme compatibility
|
54 |
css = """
|
55 |
+
/* Theme-adaptive colored info box */
|
|
|
|
|
|
|
|
|
|
|
56 |
.info-text {
|
57 |
+
background-color: rgba(53, 130, 220, 0.1);
|
58 |
padding: 12px;
|
59 |
border-radius: 8px;
|
60 |
border-left: 4px solid #3498db;
|
61 |
margin: 12px 0;
|
62 |
+
}
|
63 |
+
|
64 |
+
/* High-contrast text for elements - works in light and dark themes */
|
65 |
+
.info-text, .header, .footer, .tab-content,
|
66 |
+
button, input, textarea, select, option,
|
67 |
+
.gradio-container *, .markdown-text {
|
68 |
+
color: var(--text-color, inherit) !important;
|
69 |
}
|
70 |
|
71 |
/* Container styling */
|
|
|
78 |
.header {
|
79 |
text-align: center;
|
80 |
margin-bottom: 20px;
|
81 |
+
font-weight: bold;
|
82 |
+
font-size: 24px;
|
83 |
}
|
84 |
|
85 |
/* Footer styling */
|
|
|
87 |
text-align: center;
|
88 |
margin-top: 40px;
|
89 |
padding: 20px;
|
90 |
+
border-top: 1px solid var(--border-color-primary, #eee);
|
|
|
91 |
}
|
92 |
|
93 |
+
/* Force high contrast on specific input areas */
|
94 |
+
input[type="text"], input[type="password"], textarea {
|
95 |
+
background-color: var(--background-fill-primary) !important;
|
96 |
+
color: var(--body-text-color) !important;
|
97 |
}
|
98 |
|
99 |
+
/* Force text visibility in multiple contexts */
|
100 |
+
.gradio-markdown p, .gradio-markdown h1, .gradio-markdown h2,
|
101 |
+
.gradio-markdown h3, .gradio-markdown h4, .gradio-markdown li {
|
102 |
+
color: var(--body-text-color) !important;
|
103 |
}
|
104 |
|
105 |
+
/* Make Textbox placeholders more visible */
|
106 |
+
::placeholder {
|
107 |
+
color: var(--body-text-color-subdued) !important;
|
108 |
+
opacity: 0.7 !important;
|
109 |
}
|
110 |
|
111 |
+
/* Make tab labels more visible */
|
112 |
+
.tab-nav button {
|
113 |
+
color: var(--body-text-color) !important;
|
114 |
}
|
115 |
|
116 |
+
/* Improve contrast in dataframes */
|
117 |
+
table.dataframe th, table.dataframe td {
|
118 |
+
color: var(--body-text-color) !important;
|
119 |
}
|
120 |
|
121 |
+
/* Ensure buttons have visible text */
|
122 |
+
button.primary {
|
123 |
+
color: white !important;
|
124 |
}
|
125 |
|
126 |
+
/* Force high contrast for dropdown/select options */
|
127 |
+
.select-option {
|
128 |
+
color: var(--body-text-color) !important;
|
129 |
}
|
130 |
|
131 |
+
/* Improve visibility in dark mode specifically */
|
132 |
+
@media (prefers-color-scheme: dark) {
|
133 |
+
.info-text {
|
134 |
+
background-color: rgba(53, 130, 220, 0.2);
|
135 |
+
}
|
136 |
}
|
137 |
"""
|
138 |
|
|
|
147 |
print(f"Error starting queue worker: {e}")
|
148 |
|
149 |
# Create Gradio app
|
150 |
+
with gr.Blocks(css=css, title="Dynamic Highscores", theme=gr.themes.Default()) as app:
|
151 |
gr.Markdown("# 🏆 Dynamic Highscores", elem_classes=["header"])
|
152 |
gr.Markdown("""
|
153 |
Welcome to Dynamic Highscores - a community benchmark platform for evaluating and comparing language models.
|