Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,15 +6,13 @@ import gradio as gr
|
|
| 6 |
|
| 7 |
dropdown, js = create_theme_dropdown()
|
| 8 |
|
| 9 |
-
with gr.Blocks(theme='
|
| 10 |
with gr.Row().style(equal_height=True):
|
| 11 |
with gr.Column(scale=10):
|
| 12 |
gr.Markdown(
|
| 13 |
"""
|
| 14 |
-
# Theme preview: `
|
| 15 |
-
To use this theme, set `theme='
|
| 16 |
-
You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
|
| 17 |
-
of this theme.
|
| 18 |
"""
|
| 19 |
)
|
| 20 |
with gr.Column(scale=3):
|
|
@@ -36,8 +34,8 @@ with gr.Blocks(theme='gradio/base') as demo:
|
|
| 36 |
name = gr.Textbox(
|
| 37 |
label="Name",
|
| 38 |
info="Full name, including middle name. No special characters.",
|
| 39 |
-
placeholder="
|
| 40 |
-
value="
|
| 41 |
interactive=True,
|
| 42 |
)
|
| 43 |
|
|
@@ -97,7 +95,7 @@ with gr.Blocks(theme='gradio/base') as demo:
|
|
| 97 |
gr.JSON(
|
| 98 |
value={"a": 1, "b": 2, "c": {"test": "a", "test2": [1, 2, 3]}}, label="JSON"
|
| 99 |
)
|
| 100 |
-
gr.Label(value={"
|
| 101 |
gr.File()
|
| 102 |
with gr.Row():
|
| 103 |
gr.ColorPicker()
|
|
@@ -121,12 +119,12 @@ with gr.Blocks(theme='gradio/base') as demo:
|
|
| 121 |
|
| 122 |
with gr.Row():
|
| 123 |
with gr.Column(scale=2):
|
| 124 |
-
chatbot = gr.Chatbot([("
|
| 125 |
chat_btn = gr.Button("Add messages")
|
| 126 |
|
| 127 |
def chat(history):
|
| 128 |
time.sleep(2)
|
| 129 |
-
yield [["
|
| 130 |
|
| 131 |
chat_btn.click(
|
| 132 |
lambda history: history
|
|
@@ -137,11 +135,11 @@ with gr.Blocks(theme='gradio/base') as demo:
|
|
| 137 |
)
|
| 138 |
with gr.Column(scale=1):
|
| 139 |
with gr.Accordion("Advanced Settings"):
|
| 140 |
-
gr.Markdown("
|
| 141 |
gr.Number(label="Chatbot control 1")
|
| 142 |
gr.Number(label="Chatbot control 2")
|
| 143 |
gr.Number(label="Chatbot control 3")
|
| 144 |
|
| 145 |
|
| 146 |
if __name__ == "__main__":
|
| 147 |
-
demo.queue().launch()
|
|
|
|
| 6 |
|
| 7 |
dropdown, js = create_theme_dropdown()
|
| 8 |
|
| 9 |
+
with gr.Blocks(theme='Tonic/happyfish') as demo:
|
| 10 |
with gr.Row().style(equal_height=True):
|
| 11 |
with gr.Column(scale=10):
|
| 12 |
gr.Markdown(
|
| 13 |
"""
|
| 14 |
+
# Theme preview: `happyfish`
|
| 15 |
+
To use this theme, set `theme='Tonic/happyfish'` in `gr.Blocks()` or `gr.Interface()`.
|
|
|
|
|
|
|
| 16 |
"""
|
| 17 |
)
|
| 18 |
with gr.Column(scale=3):
|
|
|
|
| 34 |
name = gr.Textbox(
|
| 35 |
label="Name",
|
| 36 |
info="Full name, including middle name. No special characters.",
|
| 37 |
+
placeholder="Tonic the Sesh Hog",
|
| 38 |
+
value="Tonic the Sesh Hog",
|
| 39 |
interactive=True,
|
| 40 |
)
|
| 41 |
|
|
|
|
| 95 |
gr.JSON(
|
| 96 |
value={"a": 1, "b": 2, "c": {"test": "a", "test2": [1, 2, 3]}}, label="JSON"
|
| 97 |
)
|
| 98 |
+
gr.Label(value={"tonic1": 0.7, "tonic2": 0.2, "tonic3": 0.1})
|
| 99 |
gr.File()
|
| 100 |
with gr.Row():
|
| 101 |
gr.ColorPicker()
|
|
|
|
| 119 |
|
| 120 |
with gr.Row():
|
| 121 |
with gr.Column(scale=2):
|
| 122 |
+
chatbot = gr.Chatbot([("Welcome to synthvibe template", "I should check out darkmode!")], label="Chatbot")
|
| 123 |
chat_btn = gr.Button("Add messages")
|
| 124 |
|
| 125 |
def chat(history):
|
| 126 |
time.sleep(2)
|
| 127 |
+
yield [["What's my name?", "Your name is Tonic!"]]
|
| 128 |
|
| 129 |
chat_btn.click(
|
| 130 |
lambda history: history
|
|
|
|
| 135 |
)
|
| 136 |
with gr.Column(scale=1):
|
| 137 |
with gr.Accordion("Advanced Settings"):
|
| 138 |
+
gr.Markdown("Tonic")
|
| 139 |
gr.Number(label="Chatbot control 1")
|
| 140 |
gr.Number(label="Chatbot control 2")
|
| 141 |
gr.Number(label="Chatbot control 3")
|
| 142 |
|
| 143 |
|
| 144 |
if __name__ == "__main__":
|
| 145 |
+
demo.queue().launch()
|