Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,18 +2,21 @@ import time
|
|
2 |
|
3 |
import gradio as gr
|
4 |
|
5 |
-
|
6 |
from gradio.themes.utils.theme_dropdown import create_theme_dropdown
|
7 |
|
|
|
|
|
|
|
|
|
8 |
dropdown, js = create_theme_dropdown()
|
9 |
|
10 |
-
with gr.Blocks(theme='
|
11 |
with gr.Row().style(equal_height=True):
|
12 |
with gr.Column(scale=10):
|
13 |
gr.Markdown(
|
14 |
-
"""
|
15 |
-
# Theme preview: `
|
16 |
-
To use this theme, set `theme='YTheme/
|
17 |
You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
|
18 |
of this theme.
|
19 |
"""
|
@@ -65,7 +68,7 @@ with gr.Blocks(theme='YTheme/GMaterial') as demo:
|
|
65 |
check = gr.Checkbox(label="Go")
|
66 |
with gr.Column(variant="panel", scale=2):
|
67 |
img = gr.Image(
|
68 |
-
"https://huggingface.co/spaces/YTheme/
|
69 |
).style(height=320)
|
70 |
with gr.Row():
|
71 |
go_btn = gr.Button("Go", label="Primary Button", variant="primary")
|
@@ -75,7 +78,7 @@ with gr.Blocks(theme='YTheme/GMaterial') as demo:
|
|
75 |
|
76 |
def go(*args):
|
77 |
time.sleep(3)
|
78 |
-
return "https://huggingface.co/spaces/YTheme/
|
79 |
|
80 |
go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")
|
81 |
|
|
|
2 |
|
3 |
import gradio as gr
|
4 |
|
|
|
5 |
from gradio.themes.utils.theme_dropdown import create_theme_dropdown
|
6 |
|
7 |
+
|
8 |
+
THEME = 'GMaterial'
|
9 |
+
|
10 |
+
|
11 |
dropdown, js = create_theme_dropdown()
|
12 |
|
13 |
+
with gr.Blocks(theme=f'YThemes/{THEME}') as demo:
|
14 |
with gr.Row().style(equal_height=True):
|
15 |
with gr.Column(scale=10):
|
16 |
gr.Markdown(
|
17 |
+
f"""
|
18 |
+
# Theme preview: `{THEME}`
|
19 |
+
To use this theme, set `theme='YTheme/{THEME}'` in `gr.Blocks()` or `gr.Interface()`.
|
20 |
You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
|
21 |
of this theme.
|
22 |
"""
|
|
|
68 |
check = gr.Checkbox(label="Go")
|
69 |
with gr.Column(variant="panel", scale=2):
|
70 |
img = gr.Image(
|
71 |
+
f"https://huggingface.co/spaces/YTheme/{THEME}/resolve/main/header-image.jpg", label="Image"
|
72 |
).style(height=320)
|
73 |
with gr.Row():
|
74 |
go_btn = gr.Button("Go", label="Primary Button", variant="primary")
|
|
|
78 |
|
79 |
def go(*args):
|
80 |
time.sleep(3)
|
81 |
+
return f"https://huggingface.co/spaces/YTheme/{THEME}/resolve/main/header-image.jpg"
|
82 |
|
83 |
go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")
|
84 |
|