Spaces:
Runtime error
Runtime error
test: ui
Browse files
app.py
CHANGED
|
@@ -23,7 +23,42 @@ logger = logging.getLogger(__name__)
|
|
| 23 |
# Ensure using GPU if available
|
| 24 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
# Model paths and class names
|
| 28 |
MODEL_PATHS = {
|
| 29 |
"model_1": "haywoodsloan/ai-image-detector-deploy",
|
|
@@ -313,9 +348,22 @@ with gr.Blocks(css="#post-gallery { overflow: hidden !important;} .grid-wrap{ ov
|
|
| 313 |
)
|
| 314 |
|
| 315 |
with gr.Tab("🥇 Leaderboard"):
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 319 |
text_button.click(
|
| 320 |
fn=lambda x: x.upper(), # Example function to convert text to uppercase
|
| 321 |
inputs=text_input,
|
|
|
|
| 23 |
# Ensure using GPU if available
|
| 24 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 25 |
|
| 26 |
+
header_style = {
|
| 27 |
+
"textAlign": 'center',
|
| 28 |
+
"color": '#fff',
|
| 29 |
+
"height": 64,
|
| 30 |
+
"paddingInline": 48,
|
| 31 |
+
"lineHeight": '64px',
|
| 32 |
+
"backgroundColor": '#4096ff',
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
content_style = {
|
| 36 |
+
"textAlign": 'center',
|
| 37 |
+
"minHeight": 120,
|
| 38 |
+
"lineHeight": '120px',
|
| 39 |
+
"color": '#fff',
|
| 40 |
+
"backgroundColor": '#0958d9',
|
| 41 |
+
}
|
| 42 |
|
| 43 |
+
sider_style = {
|
| 44 |
+
"textAlign": 'center',
|
| 45 |
+
"lineHeight": '120px',
|
| 46 |
+
"color": '#fff',
|
| 47 |
+
"backgroundColor": '#1677ff',
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
footer_style = {
|
| 51 |
+
"textAlign": 'center',
|
| 52 |
+
"color": '#fff',
|
| 53 |
+
"backgroundColor": '#4096ff',
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
layout_style = {
|
| 57 |
+
"borderRadius": 8,
|
| 58 |
+
"overflow": 'hidden',
|
| 59 |
+
"width": 'calc(50% - 8px)',
|
| 60 |
+
"maxWidth": 'calc(50% - 8px)',
|
| 61 |
+
}
|
| 62 |
# Model paths and class names
|
| 63 |
MODEL_PATHS = {
|
| 64 |
"model_1": "haywoodsloan/ai-image-detector-deploy",
|
|
|
|
| 348 |
)
|
| 349 |
|
| 350 |
with gr.Tab("🥇 Leaderboard"):
|
| 351 |
+
|
| 352 |
+
with antd.Layout(elem_style=layout_style):
|
| 353 |
+
with antd.Layout.Sider(width="25%",
|
| 354 |
+
elem_style=sider_style):
|
| 355 |
+
ms.Text("Sider")
|
| 356 |
+
with antd.Layout():
|
| 357 |
+
with antd.Layout.Header(elem_style=header_style):
|
| 358 |
+
ms.Text("Header")
|
| 359 |
+
with antd.Layout.Content(elem_style=content_style):
|
| 360 |
+
text_input = gr.Textbox(label="Enter Text")
|
| 361 |
+
text_output = gr.Textbox(label="Processed Text")
|
| 362 |
+
text_button = gr.Button("Process Text")
|
| 363 |
+
with antd.Layout.Footer(elem_style=footer_style):
|
| 364 |
+
ms.Text("Footer")
|
| 365 |
+
|
| 366 |
+
|
| 367 |
text_button.click(
|
| 368 |
fn=lambda x: x.upper(), # Example function to convert text to uppercase
|
| 369 |
inputs=text_input,
|