Update app.py
Browse files
app.py
CHANGED
|
@@ -21,12 +21,13 @@ def blob_to_base64_html(blob_data):
|
|
| 21 |
return ""
|
| 22 |
try:
|
| 23 |
if isinstance(blob_data, (bytes, bytearray)):
|
|
|
|
| 24 |
encoded = base64.b64encode(blob_data).decode('utf-8')
|
| 25 |
-
# ๐ก [ํต์ฌ]
|
| 26 |
-
#
|
| 27 |
-
return f
|
| 28 |
return str(blob_data)
|
| 29 |
-
except Exception
|
| 30 |
return str(blob_data)
|
| 31 |
|
| 32 |
def safe_text_factory(x):
|
|
@@ -659,28 +660,30 @@ table th:nth-child(6):nth-last-child(1), table td:nth-child(6):nth-last-child(1)
|
|
| 659 |
/* -------------------------- */
|
| 660 |
/* ๊ธฐ๋ณธ ํ
์ด๋ธ & ์คํฌ๋กค ์ค์ */
|
| 661 |
/* -------------------------- */
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
.dataframe
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 670 |
vertical-align: top !important;
|
| 671 |
-
|
| 672 |
-
white-space: normal !important; /* ๊ธ์๋ ์๋ ์ค๋ฐ๊ฟ ํ์ฉ */
|
| 673 |
-
}
|
| 674 |
|
| 675 |
-
/* 3. ์ด๋ฏธ์ง ์นธ(Description)์ด ๋๋ฌด ์ข์์ง์ง ์๊ฒ ๋ฐฉ์ด */
|
| 676 |
-
.dataframe td:nth-child(2) {
|
| 677 |
-
min-width: 1250px !important;
|
| 678 |
-
}
|
| 679 |
-
|
| 680 |
-
/* 4. Gradio ๊ธฐ๋ณธ ์ด๋ฏธ์ง ์ ํ ํด์ */
|
| 681 |
-
.dataframe img {
|
| 682 |
-
max-width: none !important;
|
| 683 |
-
}
|
| 684 |
|
| 685 |
"""
|
| 686 |
if __name__ == "__main__":
|
|
|
|
| 21 |
return ""
|
| 22 |
try:
|
| 23 |
if isinstance(blob_data, (bytes, bytearray)):
|
| 24 |
+
# ๋งค๋ฒ ์ค์๊ฐ์ผ๋ก ๋ณํํฉ๋๋ค.
|
| 25 |
encoded = base64.b64encode(blob_data).decode('utf-8')
|
| 26 |
+
# ๐ก [ํต์ฌ] ํฝ์
๋จ์(width="1200")๋ก ์์ ๋ฐ์๋ฒ๋ ค์ผ ใ
๋งํ๊ฒ ์ ๋์ต๋๋ค.
|
| 27 |
+
# ์คํ์ผ ํ๊ทธ๋ณด๋ค HTML ์์ฑ์ด Gradio์์ ๋ ๊ฐ๋ ฅํ๊ฒ ๋จนํ ๋๊ฐ ๋ง์ต๋๋ค.
|
| 28 |
+
return f'<img src="data:image/png;base64,{encoded}" width="1200" style="display:block; margin:10px 0; border:1px solid #ddd;"/>'
|
| 29 |
return str(blob_data)
|
| 30 |
+
except Exception:
|
| 31 |
return str(blob_data)
|
| 32 |
|
| 33 |
def safe_text_factory(x):
|
|
|
|
| 660 |
/* -------------------------- */
|
| 661 |
/* ๊ธฐ๋ณธ ํ
์ด๋ธ & ์คํฌ๋กค ์ค์ */
|
| 662 |
/* -------------------------- */
|
| 663 |
+
thead th {
|
| 664 |
+
font-size: 18px !important;
|
| 665 |
+
position: sticky;
|
| 666 |
+
top: 0;
|
| 667 |
+
background: white;
|
| 668 |
+
z-index: 10;
|
| 669 |
+
}
|
| 670 |
+
.dataframe {
|
| 671 |
+
max-height: none !important;
|
| 672 |
+
overflow-y: visible !important;
|
| 673 |
+
}
|
| 674 |
+
.dataframe > div {
|
| 675 |
+
max-height: none !important;
|
| 676 |
+
overflow: visible !important;
|
| 677 |
+
}
|
| 678 |
+
td {
|
| 679 |
+
font-size: 18px !important;
|
| 680 |
+
white-space: pre-wrap !important;
|
| 681 |
+
word-break: break-word !important;
|
| 682 |
+
line-height: 1.6;
|
| 683 |
+
padding: 10px;
|
| 684 |
vertical-align: top !important;
|
| 685 |
+
}
|
|
|
|
|
|
|
| 686 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 687 |
|
| 688 |
"""
|
| 689 |
if __name__ == "__main__":
|