Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from gradio.themes.default import Default
|
| 3 |
+
|
| 4 |
+
class SimpleModern(Default):
|
| 5 |
+
def __init__(self):
|
| 6 |
+
super().__init__(
|
| 7 |
+
primary_hue="blue",
|
| 8 |
+
secondary_hue="gray",
|
| 9 |
+
neutral_hue="white",
|
| 10 |
+
font=("Helvetica", "Arial", "sans-serif"),
|
| 11 |
+
font_mono=("Courier New", "Courier", "monospace"),
|
| 12 |
+
spacing_size="md",
|
| 13 |
+
radius_size="md",
|
| 14 |
+
text_size="md",
|
| 15 |
+
)
|
| 16 |
+
self.name = "SimpleModern"
|
| 17 |
+
self.set(
|
| 18 |
+
background_fill_primary="#f5f5f5",
|
| 19 |
+
background_fill_secondary="#ffffff",
|
| 20 |
+
block_background_fill="#ffffff",
|
| 21 |
+
block_border_color="#e0e0e0",
|
| 22 |
+
block_shadow="none",
|
| 23 |
+
button_primary_background_fill="#007bff",
|
| 24 |
+
button_primary_text_color="#ffffff",
|
| 25 |
+
input_background_fill="#ffffff",
|
| 26 |
+
input_border_color="#ced4da",
|
| 27 |
+
input_text_color="#495057",
|
| 28 |
+
link_text_color="#007bff",
|
| 29 |
+
body_text_color="#212529",
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
# Assuming SimpleModern is your custom theme class
|
| 36 |
+
demo = gr.Interface(
|
| 37 |
+
fn=your_function,
|
| 38 |
+
inputs=gr.inputs.Textbox(),
|
| 39 |
+
outputs=gr.outputs.Textbox(),
|
| 40 |
+
theme=SimpleModern(),
|
| 41 |
+
title="Test App",
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
demo.launch()
|
| 45 |
+
|