pikto commited on
Commit
819355a
·
1 Parent(s): 00e84d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -30
app.py CHANGED
@@ -5,34 +5,6 @@ from theme_dropdown import create_theme_dropdown # noqa: F401
5
 
6
  dropdown, js = create_theme_dropdown()
7
 
8
- with gr.Blocks(theme='nota-ai/theme') as demo:
9
- with gr.Row().style(equal_height=True):
10
- with gr.Column(scale=10):
11
- gr.Markdown(
12
- """
13
- # Theme preview: `theme`
14
- To use this theme, set `theme='nota-ai/theme'` 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
- """
18
- )
19
- with gr.Column(scale=3):
20
- with gr.Box():
21
- dropdown.render()
22
- toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
23
-
24
- dropdown.change(None, dropdown, None, _js=js)
25
- toggle_dark.click(
26
- None,
27
- _js="""
28
- () => {
29
- document.body.classList.toggle('dark');
30
- document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
31
- }
32
- """,
33
- )
34
-
35
-
36
  models = [
37
  {"name": "Stable Diffusion 2", "url": "stabilityai/stable-diffusion-2-1"},
38
  {"name": "stability AI", "url": "stabilityai/stable-diffusion-2-1-base"},
@@ -126,8 +98,35 @@ with gr.Blocks(theme='nota-ai/theme') as pan:
126
  image_output = gr.Image()
127
  image_button = gr.Button("Flip")
128
 
129
- with gr.Accordion("Open for More!"):
130
- gr.Markdown("Looding....")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
  # text_button.click(flip_text, inputs=text_input, outputs=text_output)
133
  # image_button.click(flip_image, inputs=image_input, outputs=image_output)
 
5
 
6
  dropdown, js = create_theme_dropdown()
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  models = [
9
  {"name": "Stable Diffusion 2", "url": "stabilityai/stable-diffusion-2-1"},
10
  {"name": "stability AI", "url": "stabilityai/stable-diffusion-2-1-base"},
 
98
  image_output = gr.Image()
99
  image_button = gr.Button("Flip")
100
 
101
+ ##theme
102
+ with gr.Blocks(theme='nota-ai/theme') as demo:
103
+ with gr.Row().style(equal_height=True):
104
+ with gr.Column(scale=10):
105
+ gr.Markdown(
106
+ """
107
+ # Theme preview: `theme`
108
+ To use this theme, set `theme='nota-ai/theme'` in `gr.Blocks()` or `gr.Interface()`.
109
+ You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
110
+ of this theme.
111
+ """
112
+ )
113
+ with gr.Column(scale=3):
114
+ with gr.Box():
115
+ dropdown.render()
116
+ toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
117
+
118
+ dropdown.change(None, dropdown, None, _js=js)
119
+ toggle_dark.click(
120
+ None,
121
+ _js="""
122
+ () => {
123
+ document.body.classList.toggle('dark');
124
+ document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
125
+ }
126
+ """,
127
+ )
128
+
129
+
130
 
131
  # text_button.click(flip_text, inputs=text_input, outputs=text_output)
132
  # image_button.click(flip_image, inputs=image_input, outputs=image_output)