Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,18 +5,18 @@ import gradio as gr
|
|
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=
|
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='
|
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,7 +68,7 @@ with gr.Blocks(theme=f'YThemes/{THEME}') as demo:
|
|
68 |
check = gr.Checkbox(label="Go")
|
69 |
with gr.Column(variant="panel", scale=2):
|
70 |
img = gr.Image(
|
71 |
-
f"https://huggingface.co/spaces/
|
72 |
).style(height=320)
|
73 |
with gr.Row():
|
74 |
go_btn = gr.Button("Go", label="Primary Button", variant="primary")
|
@@ -78,7 +78,7 @@ with gr.Blocks(theme=f'YThemes/{THEME}') as demo:
|
|
78 |
|
79 |
def go(*args):
|
80 |
time.sleep(3)
|
81 |
-
return f"https://huggingface.co/spaces/
|
82 |
|
83 |
go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")
|
84 |
|
|
|
5 |
from gradio.themes.utils.theme_dropdown import create_theme_dropdown
|
6 |
|
7 |
|
8 |
+
THEME = 'YTheme/GMaterial'
|
9 |
|
10 |
|
11 |
dropdown, js = create_theme_dropdown()
|
12 |
|
13 |
+
with gr.Blocks(theme=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='{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/{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/{THEME}/resolve/main/header-image.jpg"
|
82 |
|
83 |
go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")
|
84 |
|