Spaces:
Sleeping
Sleeping
update to 5.0
Browse files
app.py
CHANGED
@@ -5,13 +5,13 @@ from gradio.themes.utils.theme_dropdown import create_theme_dropdown
|
|
5 |
|
6 |
dropdown, js = create_theme_dropdown()
|
7 |
|
8 |
-
with gr.Blocks(theme=
|
9 |
with gr.Row(equal_height=True):
|
10 |
with gr.Column(scale=10):
|
11 |
gr.Markdown(
|
12 |
"""
|
13 |
-
# Theme preview: `
|
14 |
-
To use this theme, set `theme='
|
15 |
You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
|
16 |
of this theme.
|
17 |
"""
|
@@ -71,15 +71,14 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme_5') as demo:
|
|
71 |
go_btn = gr.Button("Go", variant="primary")
|
72 |
clear_btn = gr.Button("Clear", variant="secondary")
|
73 |
|
74 |
-
def go(*
|
75 |
time.sleep(3)
|
76 |
-
return "https://gradio-static-files.s3.us-west-2.amazonaws.com/header-image.
|
77 |
|
78 |
go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")
|
79 |
|
80 |
def clear():
|
81 |
time.sleep(0.2)
|
82 |
-
return None
|
83 |
|
84 |
clear_btn.click(clear, None, img)
|
85 |
|
@@ -121,10 +120,6 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme_5') as demo:
|
|
121 |
chatbot = gr.Chatbot([("Hello", "Hi")], label="Chatbot")
|
122 |
chat_btn = gr.Button("Add messages")
|
123 |
|
124 |
-
def chat(history):
|
125 |
-
time.sleep(2)
|
126 |
-
yield [["How are you?", "I am good."]]
|
127 |
-
|
128 |
chat_btn.click(
|
129 |
lambda history: history
|
130 |
+ [["How are you?", "I am good."]]
|
@@ -141,4 +136,4 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme_5') as demo:
|
|
141 |
|
142 |
|
143 |
if __name__ == "__main__":
|
144 |
-
demo.queue().launch()
|
|
|
5 |
|
6 |
dropdown, js = create_theme_dropdown()
|
7 |
|
8 |
+
with gr.Blocks(theme=gr.themes.Default()) as demo:
|
9 |
with gr.Row(equal_height=True):
|
10 |
with gr.Column(scale=10):
|
11 |
gr.Markdown(
|
12 |
"""
|
13 |
+
# Theme preview: `{THEME}`
|
14 |
+
To use this theme, set `theme='{AUTHOR}/{SPACE_NAME}'` in `gr.Blocks()` or `gr.Interface()`.
|
15 |
You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
|
16 |
of this theme.
|
17 |
"""
|
|
|
71 |
go_btn = gr.Button("Go", variant="primary")
|
72 |
clear_btn = gr.Button("Clear", variant="secondary")
|
73 |
|
74 |
+
def go(*_args):
|
75 |
time.sleep(3)
|
76 |
+
return "https://gradio-static-files.s3.us-west-2.amazonaws.com/header-image.jpg"
|
77 |
|
78 |
go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")
|
79 |
|
80 |
def clear():
|
81 |
time.sleep(0.2)
|
|
|
82 |
|
83 |
clear_btn.click(clear, None, img)
|
84 |
|
|
|
120 |
chatbot = gr.Chatbot([("Hello", "Hi")], label="Chatbot")
|
121 |
chat_btn = gr.Button("Add messages")
|
122 |
|
|
|
|
|
|
|
|
|
123 |
chat_btn.click(
|
124 |
lambda history: history
|
125 |
+ [["How are you?", "I am good."]]
|
|
|
136 |
|
137 |
|
138 |
if __name__ == "__main__":
|
139 |
+
demo.queue().launch()
|