Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -1342,21 +1342,45 @@ html, body {
|
|
| 1342 |
font-weight: 900 !important;
|
| 1343 |
}
|
| 1344 |
|
| 1345 |
-
/*
|
| 1346 |
-
|
| 1347 |
-
Neutral gray only: no gradient, cyan glow, dashed drop-zone treatment, or large upload card. */
|
| 1348 |
.input-file-example {
|
| 1349 |
width: 100% !important;
|
| 1350 |
-
max-width:
|
| 1351 |
-
margin
|
| 1352 |
-
margin-right: auto !important;
|
| 1353 |
-
gap: 0.5rem !important; /* Tailwind space-y-2 */
|
| 1354 |
padding: 0 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1355 |
background: transparent !important;
|
| 1356 |
border: 0 !important;
|
| 1357 |
box-shadow: none !important;
|
| 1358 |
}
|
| 1359 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1360 |
.input-file-example .input-file-label {
|
| 1361 |
display: block !important;
|
| 1362 |
margin: 0 !important;
|
|
@@ -1364,13 +1388,12 @@ html, body {
|
|
| 1364 |
font-size: 0.875rem !important;
|
| 1365 |
line-height: 1.25rem !important;
|
| 1366 |
font-weight: 500 !important;
|
|
|
|
| 1367 |
}
|
| 1368 |
|
| 1369 |
-
/* Gradio component shell:
|
| 1370 |
.input-file-control {
|
| 1371 |
-
|
| 1372 |
-
min-width: 0 !important;
|
| 1373 |
-
margin-top: 0.5rem !important; /* mt-2 */
|
| 1374 |
padding: 0 !important;
|
| 1375 |
background: transparent !important;
|
| 1376 |
border: 0 !important;
|
|
@@ -1482,11 +1505,12 @@ html, body {
|
|
| 1482 |
}
|
| 1483 |
|
| 1484 |
.input-file-example .input-file-help {
|
| 1485 |
-
margin: 0
|
| 1486 |
-
color: #6b7280 !important;
|
| 1487 |
-
font-size: 0.75rem !important;
|
| 1488 |
line-height: 1rem !important;
|
| 1489 |
font-weight: 400 !important;
|
|
|
|
| 1490 |
}
|
| 1491 |
|
| 1492 |
.gradio-container table,
|
|
@@ -1666,9 +1690,12 @@ except Exception:
|
|
| 1666 |
HORT_THEME = None
|
| 1667 |
|
| 1668 |
def make_exact_file_input():
|
| 1669 |
-
"""Render
|
| 1670 |
-
with gr.
|
| 1671 |
-
gr.HTML(
|
|
|
|
|
|
|
|
|
|
| 1672 |
file_component = gr.File(
|
| 1673 |
label="Upload a file",
|
| 1674 |
show_label=False,
|
|
@@ -1676,7 +1703,10 @@ def make_exact_file_input():
|
|
| 1676 |
height=36,
|
| 1677 |
elem_classes=["input-file-control"]
|
| 1678 |
)
|
| 1679 |
-
gr.HTML(
|
|
|
|
|
|
|
|
|
|
| 1680 |
return file_component
|
| 1681 |
|
| 1682 |
|
|
|
|
| 1342 |
font-weight: 900 !important;
|
| 1343 |
}
|
| 1344 |
|
| 1345 |
+
/* File input laid out as one horizontal row:
|
| 1346 |
+
label | compact file picker | helper text. */
|
|
|
|
| 1347 |
.input-file-example {
|
| 1348 |
width: 100% !important;
|
| 1349 |
+
max-width: none !important;
|
| 1350 |
+
margin: 0 !important;
|
|
|
|
|
|
|
| 1351 |
padding: 0 !important;
|
| 1352 |
+
display: flex !important;
|
| 1353 |
+
flex-direction: row !important;
|
| 1354 |
+
align-items: center !important;
|
| 1355 |
+
justify-content: flex-start !important;
|
| 1356 |
+
flex-wrap: nowrap !important;
|
| 1357 |
+
gap: 0.75rem !important;
|
| 1358 |
background: transparent !important;
|
| 1359 |
border: 0 !important;
|
| 1360 |
box-shadow: none !important;
|
| 1361 |
}
|
| 1362 |
|
| 1363 |
+
/* Keep Gradio's child wrappers from stretching each item onto its own line. */
|
| 1364 |
+
.input-file-example > * {
|
| 1365 |
+
margin: 0 !important;
|
| 1366 |
+
}
|
| 1367 |
+
.input-file-example .input-file-label-wrap {
|
| 1368 |
+
flex: 0 0 auto !important;
|
| 1369 |
+
width: auto !important;
|
| 1370 |
+
min-width: max-content !important;
|
| 1371 |
+
}
|
| 1372 |
+
.input-file-example .input-file-control {
|
| 1373 |
+
flex: 0 0 20rem !important;
|
| 1374 |
+
width: 20rem !important;
|
| 1375 |
+
max-width: 20rem !important;
|
| 1376 |
+
min-width: 16rem !important;
|
| 1377 |
+
}
|
| 1378 |
+
.input-file-example .input-file-help-wrap {
|
| 1379 |
+
flex: 1 1 auto !important;
|
| 1380 |
+
width: auto !important;
|
| 1381 |
+
min-width: 0 !important;
|
| 1382 |
+
}
|
| 1383 |
+
|
| 1384 |
.input-file-example .input-file-label {
|
| 1385 |
display: block !important;
|
| 1386 |
margin: 0 !important;
|
|
|
|
| 1388 |
font-size: 0.875rem !important;
|
| 1389 |
line-height: 1.25rem !important;
|
| 1390 |
font-weight: 500 !important;
|
| 1391 |
+
white-space: nowrap !important;
|
| 1392 |
}
|
| 1393 |
|
| 1394 |
+
/* Gradio component shell: compact native-style file field. */
|
| 1395 |
.input-file-control {
|
| 1396 |
+
margin: 0 !important;
|
|
|
|
|
|
|
| 1397 |
padding: 0 !important;
|
| 1398 |
background: transparent !important;
|
| 1399 |
border: 0 !important;
|
|
|
|
| 1505 |
}
|
| 1506 |
|
| 1507 |
.input-file-example .input-file-help {
|
| 1508 |
+
margin: 0 !important;
|
| 1509 |
+
color: #6b7280 !important;
|
| 1510 |
+
font-size: 0.75rem !important;
|
| 1511 |
line-height: 1rem !important;
|
| 1512 |
font-weight: 400 !important;
|
| 1513 |
+
white-space: nowrap !important;
|
| 1514 |
}
|
| 1515 |
|
| 1516 |
.gradio-container table,
|
|
|
|
| 1690 |
HORT_THEME = None
|
| 1691 |
|
| 1692 |
def make_exact_file_input():
|
| 1693 |
+
"""Render label, file picker, and helper text on one horizontal line."""
|
| 1694 |
+
with gr.Row(elem_classes=["input-file-example"]):
|
| 1695 |
+
gr.HTML(
|
| 1696 |
+
'<label class="input-file-label">Upload a file</label>',
|
| 1697 |
+
elem_classes=["input-file-label-wrap"]
|
| 1698 |
+
)
|
| 1699 |
file_component = gr.File(
|
| 1700 |
label="Upload a file",
|
| 1701 |
show_label=False,
|
|
|
|
| 1703 |
height=36,
|
| 1704 |
elem_classes=["input-file-control"]
|
| 1705 |
)
|
| 1706 |
+
gr.HTML(
|
| 1707 |
+
'<p class="input-file-help">You are only allowed to upload .CSV, .XLSX or .XLS files.</p>',
|
| 1708 |
+
elem_classes=["input-file-help-wrap"]
|
| 1709 |
+
)
|
| 1710 |
return file_component
|
| 1711 |
|
| 1712 |
|