Enhance mobile responsiveness of the Gradio app by adding CSS styles for various screen sizes and updating the HTML structure for better layout. Include viewport meta tag for improved scaling on mobile devices.
Browse files- ui_main.py +5 -3
- ui_utils.py +323 -0
ui_main.py
CHANGED
|
@@ -23,9 +23,11 @@ def create_clean_app():
|
|
| 23 |
available_models = []
|
| 24 |
data_status = f"✅ Yüklendi: {len(leaderboard_data)} liderlik tablosu girişi, {len(responses_data)} cevap, {len(available_models)} model"
|
| 25 |
|
| 26 |
-
with gr.Blocks(css=CLEAN_CSS, title="Türkçe MMLU Liderlik Tablosu"
|
|
|
|
|
|
|
| 27 |
gr.HTML(f"""
|
| 28 |
-
<div class
|
| 29 |
<h1>🏆 Türkçe MMLU Liderlik Tablosu</h1>
|
| 30 |
<p>Yapay zeka modellerinin Türkçe dil görevlerindeki kapsamlı değerlendirmesi</p>
|
| 31 |
</div>
|
|
@@ -40,7 +42,7 @@ def create_clean_app():
|
|
| 40 |
add_submit_model_tab(tabs, api_service)
|
| 41 |
|
| 42 |
gr.HTML("""
|
| 43 |
-
<div style
|
| 44 |
<p>🏆 Türkçe MMLU Liderlik Tablosu • Gradio ile Geliştirildi</p>
|
| 45 |
</div>
|
| 46 |
""")
|
|
|
|
| 23 |
available_models = []
|
| 24 |
data_status = f"✅ Yüklendi: {len(leaderboard_data)} liderlik tablosu girişi, {len(responses_data)} cevap, {len(available_models)} model"
|
| 25 |
|
| 26 |
+
with gr.Blocks(css=CLEAN_CSS, title="Türkçe MMLU Liderlik Tablosu", head="""
|
| 27 |
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
| 28 |
+
""") as app:
|
| 29 |
gr.HTML(f"""
|
| 30 |
+
<div class="main-header">
|
| 31 |
<h1>🏆 Türkçe MMLU Liderlik Tablosu</h1>
|
| 32 |
<p>Yapay zeka modellerinin Türkçe dil görevlerindeki kapsamlı değerlendirmesi</p>
|
| 33 |
</div>
|
|
|
|
| 42 |
add_submit_model_tab(tabs, api_service)
|
| 43 |
|
| 44 |
gr.HTML("""
|
| 45 |
+
<div style="text-align: center; padding: 20px; color: #64748b; border-top: 1px solid #e2e8f0; margin-top: 40px;">
|
| 46 |
<p>🏆 Türkçe MMLU Liderlik Tablosu • Gradio ile Geliştirildi</p>
|
| 47 |
</div>
|
| 48 |
""")
|
ui_utils.py
CHANGED
|
@@ -61,4 +61,327 @@ CLEAN_CSS = """
|
|
| 61 |
.status-processing { border-left-color: #3b82f6; }
|
| 62 |
.status-completed { border-left-color: #10b981; }
|
| 63 |
.status-failed { border-left-color: #ef4444; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
"""
|
|
|
|
| 61 |
.status-processing { border-left-color: #3b82f6; }
|
| 62 |
.status-completed { border-left-color: #10b981; }
|
| 63 |
.status-failed { border-left-color: #ef4444; }
|
| 64 |
+
|
| 65 |
+
/* Mobile Responsive Styles */
|
| 66 |
+
@media screen and (max-width: 768px) {
|
| 67 |
+
.gradio-container {
|
| 68 |
+
max-width: 100% !important;
|
| 69 |
+
padding: 0 10px !important;
|
| 70 |
+
margin: 0 !important;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
.main-header {
|
| 74 |
+
padding: 1.5rem 1rem !important;
|
| 75 |
+
margin-bottom: 1.5rem !important;
|
| 76 |
+
border-radius: 8px !important;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
.main-header h1 {
|
| 80 |
+
font-size: 1.8rem !important;
|
| 81 |
+
line-height: 1.2 !important;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
.main-header p {
|
| 85 |
+
font-size: 1rem !important;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
.status-info {
|
| 89 |
+
padding: 0.8rem !important;
|
| 90 |
+
margin: 0.8rem 0 !important;
|
| 91 |
+
font-size: 0.85rem !important;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
/* Mobile Row Layouts */
|
| 95 |
+
.gradio-row {
|
| 96 |
+
flex-direction: column !important;
|
| 97 |
+
gap: 0.5rem !important;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
.gradio-column {
|
| 101 |
+
width: 100% !important;
|
| 102 |
+
min-width: 100% !important;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
/* Mobile Button Groups */
|
| 106 |
+
.gradio-row .gr-button {
|
| 107 |
+
width: 100% !important;
|
| 108 |
+
margin: 0.25rem 0 !important;
|
| 109 |
+
padding: 0.75rem !important;
|
| 110 |
+
font-size: 0.9rem !important;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
/* Mobile Dropdowns and Inputs */
|
| 114 |
+
.gr-dropdown,
|
| 115 |
+
.gr-textbox,
|
| 116 |
+
.gr-slider {
|
| 117 |
+
width: 100% !important;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
.gr-dropdown label,
|
| 121 |
+
.gr-textbox label,
|
| 122 |
+
.gr-slider label {
|
| 123 |
+
font-size: 0.9rem !important;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
/* Mobile Tables */
|
| 127 |
+
.gr-dataframe {
|
| 128 |
+
overflow-x: auto !important;
|
| 129 |
+
font-size: 0.85rem !important;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
.gr-dataframe table {
|
| 133 |
+
min-width: 600px !important;
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
.gr-dataframe th,
|
| 137 |
+
.gr-dataframe td {
|
| 138 |
+
padding: 0.5rem !important;
|
| 139 |
+
white-space: nowrap !important;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
/* Mobile Tabs */
|
| 143 |
+
.gradio-tabs {
|
| 144 |
+
overflow-x: auto !important;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
.gradio-tabs .tab-nav {
|
| 148 |
+
flex-wrap: nowrap !important;
|
| 149 |
+
overflow-x: auto !important;
|
| 150 |
+
scrollbar-width: thin !important;
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
.gradio-tabs .tab-nav button {
|
| 154 |
+
min-width: 120px !important;
|
| 155 |
+
font-size: 0.85rem !important;
|
| 156 |
+
padding: 0.5rem 0.75rem !important;
|
| 157 |
+
white-space: nowrap !important;
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
/* Mobile Accordions */
|
| 161 |
+
.gr-accordion {
|
| 162 |
+
margin: 0.5rem 0 !important;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
.gr-accordion summary {
|
| 166 |
+
font-size: 0.9rem !important;
|
| 167 |
+
padding: 0.75rem !important;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
/* Mobile Checkbox Groups */
|
| 171 |
+
.gr-checkbox-group {
|
| 172 |
+
max-height: 200px !important;
|
| 173 |
+
overflow-y: auto !important;
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
.gr-checkbox-group label {
|
| 177 |
+
font-size: 0.85rem !important;
|
| 178 |
+
padding: 0.5rem !important;
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
/* Mobile Markdown */
|
| 182 |
+
.gr-markdown h1,
|
| 183 |
+
.gr-markdown h2,
|
| 184 |
+
.gr-markdown h3 {
|
| 185 |
+
font-size: 1.2rem !important;
|
| 186 |
+
line-height: 1.3 !important;
|
| 187 |
+
margin: 1rem 0 0.5rem 0 !important;
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
.gr-markdown p {
|
| 191 |
+
font-size: 0.9rem !important;
|
| 192 |
+
line-height: 1.4 !important;
|
| 193 |
+
margin: 0.5rem 0 !important;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
/* Mobile Evaluation Cards */
|
| 197 |
+
.evaluation-card {
|
| 198 |
+
padding: 15px !important;
|
| 199 |
+
margin: 8px 0 !important;
|
| 200 |
+
border-radius: 8px !important;
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
/* Mobile HTML Components */
|
| 204 |
+
.gr-html {
|
| 205 |
+
font-size: 0.85rem !important;
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
.gr-html div[style*="grid-template-columns"] {
|
| 209 |
+
display: block !important;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
.gr-html div[style*="grid-template-columns"] > div {
|
| 213 |
+
margin-bottom: 1rem !important;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
/* Mobile Footer */
|
| 217 |
+
.gradio-container > div:last-child {
|
| 218 |
+
font-size: 0.8rem !important;
|
| 219 |
+
padding: 15px !important;
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
/* Mobile Pagination */
|
| 223 |
+
.gr-slider {
|
| 224 |
+
margin: 0.5rem 0 !important;
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
.gr-slider label {
|
| 228 |
+
margin-bottom: 0.5rem !important;
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
/* Mobile Navigation Buttons */
|
| 232 |
+
.gradio-row button[aria-label*="Previous"],
|
| 233 |
+
.gradio-row button[aria-label*="Next"],
|
| 234 |
+
button:contains("Önceki"),
|
| 235 |
+
button:contains("Sonraki") {
|
| 236 |
+
flex: 1 !important;
|
| 237 |
+
min-width: 120px !important;
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
/* Mobile Form Elements */
|
| 241 |
+
.gr-textbox input,
|
| 242 |
+
.gr-dropdown select {
|
| 243 |
+
font-size: 16px !important; /* Prevents zoom on iOS */
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
/* Mobile Info Sections */
|
| 247 |
+
.gr-html div[style*="padding: 15px"] {
|
| 248 |
+
padding: 12px !important;
|
| 249 |
+
font-size: 0.85rem !important;
|
| 250 |
+
line-height: 1.4 !important;
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
/* Mobile Status Messages */
|
| 254 |
+
.gr-html div[style*="color: green"],
|
| 255 |
+
.gr-html div[style*="color: red"],
|
| 256 |
+
.gr-html div[style*="color: orange"] {
|
| 257 |
+
margin: 0.5rem 0 !important;
|
| 258 |
+
border-radius: 6px !important;
|
| 259 |
+
}
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
/* Tablet Responsive Styles */
|
| 263 |
+
@media screen and (min-width: 769px) and (max-width: 1024px) {
|
| 264 |
+
.gradio-container {
|
| 265 |
+
max-width: 95% !important;
|
| 266 |
+
padding: 0 20px !important;
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
.main-header {
|
| 270 |
+
padding: 1.8rem !important;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
.main-header h1 {
|
| 274 |
+
font-size: 2.2rem !important;
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
.gr-dataframe table {
|
| 278 |
+
font-size: 0.9rem !important;
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
.gradio-tabs .tab-nav button {
|
| 282 |
+
font-size: 0.9rem !important;
|
| 283 |
+
}
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
/* Touch-friendly interactions */
|
| 287 |
+
@media (hover: none) and (pointer: coarse) {
|
| 288 |
+
.gr-button {
|
| 289 |
+
min-height: 44px !important;
|
| 290 |
+
padding: 0.75rem 1rem !important;
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
.gradio-tabs .tab-nav button {
|
| 294 |
+
min-height: 44px !important;
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
.gr-dropdown,
|
| 298 |
+
.gr-textbox input {
|
| 299 |
+
min-height: 44px !important;
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
.gr-checkbox-group label {
|
| 303 |
+
min-height: 44px !important;
|
| 304 |
+
display: flex !important;
|
| 305 |
+
align-items: center !important;
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
/* Better touch targets for navigation */
|
| 309 |
+
.gr-accordion summary {
|
| 310 |
+
min-height: 44px !important;
|
| 311 |
+
display: flex !important;
|
| 312 |
+
align-items: center !important;
|
| 313 |
+
}
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
/* Horizontal scroll for tables on small screens */
|
| 317 |
+
@media screen and (max-width: 480px) {
|
| 318 |
+
.gr-dataframe {
|
| 319 |
+
border-radius: 4px !important;
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
.gr-dataframe table {
|
| 323 |
+
min-width: 500px !important;
|
| 324 |
+
font-size: 0.8rem !important;
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
.gr-dataframe th,
|
| 328 |
+
.gr-dataframe td {
|
| 329 |
+
padding: 0.4rem !important;
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
.main-header h1 {
|
| 333 |
+
font-size: 1.5rem !important;
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
.main-header p {
|
| 337 |
+
font-size: 0.9rem !important;
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
.gradio-tabs .tab-nav button {
|
| 341 |
+
min-width: 100px !important;
|
| 342 |
+
font-size: 0.8rem !important;
|
| 343 |
+
padding: 0.4rem 0.6rem !important;
|
| 344 |
+
}
|
| 345 |
+
|
| 346 |
+
/* Very small screen adjustments */
|
| 347 |
+
.gradio-container {
|
| 348 |
+
padding: 0 5px !important;
|
| 349 |
+
}
|
| 350 |
+
|
| 351 |
+
.main-header {
|
| 352 |
+
padding: 1rem 0.75rem !important;
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
.status-info {
|
| 356 |
+
padding: 0.6rem !important;
|
| 357 |
+
font-size: 0.8rem !important;
|
| 358 |
+
}
|
| 359 |
+
|
| 360 |
+
/* Compact button layout for very small screens */
|
| 361 |
+
.gradio-row .gr-button {
|
| 362 |
+
padding: 0.6rem !important;
|
| 363 |
+
font-size: 0.85rem !important;
|
| 364 |
+
}
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
/* Landscape orientation on phones */
|
| 368 |
+
@media screen and (max-height: 480px) and (orientation: landscape) {
|
| 369 |
+
.main-header {
|
| 370 |
+
padding: 1rem !important;
|
| 371 |
+
margin-bottom: 1rem !important;
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
.main-header h1 {
|
| 375 |
+
font-size: 1.6rem !important;
|
| 376 |
+
margin-bottom: 0.25rem !important;
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
.main-header p {
|
| 380 |
+
font-size: 0.9rem !important;
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
.gr-accordion {
|
| 384 |
+
margin: 0.25rem 0 !important;
|
| 385 |
+
}
|
| 386 |
+
}
|
| 387 |
"""
|