Spaces:
Runtime error
Runtime error
Dagfinn1962
commited on
Commit
•
698a1fa
1
Parent(s):
df6ace3
Update app.py
Browse files
app.py
CHANGED
@@ -7,35 +7,9 @@ import base64
|
|
7 |
import os
|
8 |
from PIL import Image
|
9 |
from io import BytesIO
|
10 |
-
from gradio.themes.utils.theme_dropdown import create_theme_dropdown
|
11 |
|
12 |
-
dropdown, js = create_theme_dropdown()
|
13 |
|
14 |
-
|
15 |
-
with gr.Row().style(equal_height=True):
|
16 |
-
with gr.Column(scale=10):
|
17 |
-
gr.Markdown(
|
18 |
-
"""
|
19 |
-
# Theme preview: `theme_demo`
|
20 |
-
To use this theme, set `theme='xiaobaiyuan/theme_demo'` in `gr.Blocks()` or `gr.Interface()`.
|
21 |
-
You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
|
22 |
-
of this theme.
|
23 |
-
"""
|
24 |
-
)
|
25 |
-
with gr.Column(scale=3):
|
26 |
-
with gr.Box():
|
27 |
-
dropdown.render()
|
28 |
-
toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
|
29 |
-
|
30 |
-
dropdown.change(None, dropdown, None, _js=js)
|
31 |
-
toggle_dark.click(
|
32 |
-
None,
|
33 |
-
_js="""
|
34 |
-
() => {
|
35 |
-
document.body.classList.toggle('dark');
|
36 |
-
}
|
37 |
-
""",
|
38 |
-
)
|
39 |
|
40 |
class Prodia:
|
41 |
def __init__(self, api_key, base=None):
|
@@ -129,7 +103,7 @@ css = """
|
|
129 |
}
|
130 |
"""
|
131 |
|
132 |
-
with gr.Blocks(
|
133 |
|
134 |
|
135 |
with gr.Row():
|
|
|
7 |
import os
|
8 |
from PIL import Image
|
9 |
from io import BytesIO
|
|
|
10 |
|
|
|
11 |
|
12 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
class Prodia:
|
15 |
def __init__(self, api_key, base=None):
|
|
|
103 |
}
|
104 |
"""
|
105 |
|
106 |
+
with gr.Blocks(theme='xiaobaiyuan/theme_demo') as demo:
|
107 |
|
108 |
|
109 |
with gr.Row():
|