Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
| 1 |
import time
|
| 2 |
|
| 3 |
-
from theme_dropdown import create_theme_dropdown # noqa: F401
|
| 4 |
-
|
| 5 |
import gradio as gr
|
|
|
|
| 6 |
|
| 7 |
dropdown, js = create_theme_dropdown()
|
| 8 |
|
|
@@ -28,7 +27,6 @@ with gr.Blocks(theme='Taithrah/Minimal') as demo:
|
|
| 28 |
_js="""
|
| 29 |
() => {
|
| 30 |
document.body.classList.toggle('dark');
|
| 31 |
-
document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
|
| 32 |
}
|
| 33 |
""",
|
| 34 |
)
|
|
@@ -65,7 +63,8 @@ with gr.Blocks(theme='Taithrah/Minimal') as demo:
|
|
| 65 |
check = gr.Checkbox(label="Go")
|
| 66 |
with gr.Column(variant="panel", scale=2):
|
| 67 |
img = gr.Image(
|
| 68 |
-
"https://gradio.
|
|
|
|
| 69 |
).style(height=320)
|
| 70 |
with gr.Row():
|
| 71 |
go_btn = gr.Button("Go", label="Primary Button", variant="primary")
|
|
@@ -75,7 +74,7 @@ with gr.Blocks(theme='Taithrah/Minimal') as demo:
|
|
| 75 |
|
| 76 |
def go(*args):
|
| 77 |
time.sleep(3)
|
| 78 |
-
return "https://gradio.
|
| 79 |
|
| 80 |
go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")
|
| 81 |
|
|
@@ -144,4 +143,4 @@ with gr.Blocks(theme='Taithrah/Minimal') as demo:
|
|
| 144 |
|
| 145 |
|
| 146 |
if __name__ == "__main__":
|
| 147 |
-
demo.queue().launch()
|
|
|
|
| 1 |
import time
|
| 2 |
|
|
|
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
+
from gradio.themes.utils.theme_dropdown import create_theme_dropdown
|
| 5 |
|
| 6 |
dropdown, js = create_theme_dropdown()
|
| 7 |
|
|
|
|
| 27 |
_js="""
|
| 28 |
() => {
|
| 29 |
document.body.classList.toggle('dark');
|
|
|
|
| 30 |
}
|
| 31 |
""",
|
| 32 |
)
|
|
|
|
| 63 |
check = gr.Checkbox(label="Go")
|
| 64 |
with gr.Column(variant="panel", scale=2):
|
| 65 |
img = gr.Image(
|
| 66 |
+
"https://gradio-static-files.s3.us-west-2.amazonaws.com/header-image.jpg",
|
| 67 |
+
label="Image",
|
| 68 |
).style(height=320)
|
| 69 |
with gr.Row():
|
| 70 |
go_btn = gr.Button("Go", label="Primary Button", variant="primary")
|
|
|
|
| 74 |
|
| 75 |
def go(*args):
|
| 76 |
time.sleep(3)
|
| 77 |
+
return "https://gradio-static-files.s3.us-west-2.amazonaws.com/header-image.jpgjpg"
|
| 78 |
|
| 79 |
go_btn.click(go, [radio, drop, drop_2, check, name], img, api_name="go")
|
| 80 |
|
|
|
|
| 143 |
|
| 144 |
|
| 145 |
if __name__ == "__main__":
|
| 146 |
+
demo.queue().launch()
|