elismasilva commited on
Commit
86e09db
·
verified ·
1 Parent(s): 06f872a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +284 -284
app.py CHANGED
@@ -1,285 +1,285 @@
1
- # app.py
2
-
3
- import gradio as gr
4
- from gradio_creditspanel import CreditsPanel
5
- import os
6
-
7
- def setup_demo_files():
8
- """Creates necessary directories and dummy files for the demo."""
9
- os.makedirs("LICENSES", exist_ok=True)
10
- if not os.path.exists("LICENSES/Apache.txt"):
11
- with open("LICENSES/Apache.txt", "w") as f:
12
- f.write("Apache License\nVersion 2.0, January 2004...")
13
- if not os.path.exists("LICENSES/MIT.txt"):
14
- with open("LICENSES/MIT.txt", "w") as f:
15
- f.write("MIT License\nCopyright (c) 2025 Author...")
16
-
17
- md_content = ""
18
- if not os.path.exists("LICENSES/Component_License.md"):
19
- md_content = """
20
- # Component License (Markdown)
21
-
22
- This is a sample license file written in **Markdown** to demonstrate rendering capabilities.
23
-
24
- ## Key Points
25
- - You are free to use this component in your projects.
26
- - Attribution is appreciated but not required.
27
- - The component is provided *as-is*, without warranty.
28
-
29
- ## More Information
30
- For more details, please visit the [Gradio website](https://www.gradio.app).
31
-
32
- ```python
33
- print("Hello, Gradio!")
34
- ```
35
- """
36
- with open("LICENSES/Component_License.md", "w") as f:
37
- f.write(md_content)
38
-
39
- os.makedirs("assets", exist_ok=True)
40
- if not os.path.exists("./assets/logo.webp"):
41
- with open("./assets/logo.webp", "w") as f:
42
- f.write("Placeholder WebP logo")
43
-
44
- # --- Credits list with sections ---
45
- credits_list = [
46
- {"section_title": "Project Leadership"},
47
- {"title": "Project Manager", "name": "Emma Thompson"},
48
- {"title": "Scrum Master", "name": "Ava Rodriguez"},
49
-
50
- {"section_title": "Development Team"},
51
- {"title": "Lead Developer", "name": "John Doe"},
52
- {"title": "Senior Backend Engineer", "name": "Michael Chen"},
53
- {"title": "Frontend Developer", "name": "Sarah Johnson"},
54
- {"title": "UI/UX Designer", "name": "Jane Smith"},
55
- {"title": "Database Architect", "name": "Alex Ray"},
56
-
57
- {"section_title": "Quality & Operations"},
58
- {"title": "DevOps Engineer", "name": "Liam Patel"},
59
- {"title": "Quality Assurance Lead", "name": "Sam Wilson"},
60
- {"title": "Test Automation Engineer", "name": "Olivia Brown"},
61
- ]
62
-
63
- license_paths = {
64
- "Gradio Framework": "./LICENSES/Apache.txt",
65
- "This Component": "./LICENSES/MIT.txt",
66
- "(MD) File Example": "./LICENSES/Component_License.md"
67
- }
68
-
69
- DEFAULT_SPEEDS = {
70
- "scroll": 40.0,
71
- "starwars": 70.0,
72
- "matrix": 40.0
73
- }
74
- SCROLL_LOGO_PATH = "./assets/gradio_logo_white.png"
75
- LOGO_PATH="./assets/logo.webp"
76
-
77
- def update_panel(
78
- effect: str,
79
- speed: float,
80
- base_font_size: float,
81
- intro_title: str,
82
- intro_subtitle: str,
83
- sidebar_position: str,
84
- show_logo: bool,
85
- show_licenses: bool,
86
- show_credits: bool,
87
- logo_position: str,
88
- logo_sizing: str,
89
- logo_width: str | None,
90
- logo_height: str | None,
91
- scroll_background_color: str | None,
92
- scroll_title_color: str | None,
93
- scroll_section_title_color: str | None,
94
- scroll_name_color: str | None,
95
- layout_style: str,
96
- title_uppercase: bool,
97
- name_uppercase: bool,
98
- section_title_uppercase: bool,
99
- swap_font_sizes: bool,
100
- show_scroll_logo: bool,
101
- scroll_logo_height: str | None
102
- ) -> dict:
103
- """Callback function that updates all properties of the CreditsPanel component."""
104
-
105
- scroll_logo_path = SCROLL_LOGO_PATH if show_scroll_logo else None
106
-
107
- if not scroll_logo_height:
108
- scroll_logo_height = "120px"
109
-
110
- return {
111
- "credits": credits_list,
112
- "licenses": license_paths,
113
- "effect": effect,
114
- "speed": speed,
115
- "base_font_size": base_font_size,
116
- "intro_title": intro_title,
117
- "intro_subtitle": intro_subtitle,
118
- "sidebar_position": sidebar_position,
119
- "logo_path": LOGO_PATH,
120
- "show_logo": show_logo,
121
- "show_licenses": show_licenses,
122
- "show_credits": show_credits,
123
- "logo_position": logo_position,
124
- "logo_sizing": logo_sizing,
125
- "logo_width": logo_width,
126
- "logo_height": logo_height,
127
- "scroll_background_color": scroll_background_color,
128
- "scroll_title_color": scroll_title_color,
129
- "scroll_name_color": scroll_name_color,
130
- "scroll_section_title_color": scroll_section_title_color,
131
- "layout_style": layout_style,
132
- "title_uppercase": title_uppercase,
133
- "name_uppercase": name_uppercase,
134
- "section_title_uppercase": section_title_uppercase,
135
- "swap_font_sizes_on_two_column": swap_font_sizes,
136
- "scroll_logo_path": scroll_logo_path,
137
- "scroll_logo_height": scroll_logo_height,
138
- }
139
-
140
- def update_ui_on_effect_change(effect: str) -> tuple[float, float]:
141
- """Updates sliders to sensible defaults when the animation effect is changed."""
142
- font_size = 1.5
143
- if effect == "starwars":
144
- font_size = 3.8
145
- speed = DEFAULT_SPEEDS.get(effect, 40.0)
146
- return speed, font_size
147
-
148
- def toggle_swap_checkbox_visibility(layout: str) -> dict:
149
- """Show the swap checkbox only for the two-column layout."""
150
- return gr.update(visible=(layout == 'two-column'))
151
-
152
- with gr.Blocks(theme=gr.themes.Ocean(), title="CreditsPanel Demo") as demo:
153
- gr.Markdown(
154
- """
155
- # Interactive CreditsPanel Demo
156
- Use the sidebar controls to customize the `CreditsPanel` component in real-time.
157
- """
158
- )
159
-
160
- with gr.Sidebar(position="right"):
161
- gr.Markdown("### Effects Settings")
162
- effect_radio = gr.Radio(["scroll", "starwars", "matrix"], label="Animation Effect", value="scroll")
163
- speed_slider = gr.Slider(minimum=5.0, maximum=100.0, step=1.0, value=DEFAULT_SPEEDS["scroll"], label="Animation Speed")
164
- font_size_slider = gr.Slider(minimum=1.0, maximum=10.0, step=0.1, value=1.5, label="Base Font Size")
165
-
166
- gr.Markdown("### Credits Layout Settings")
167
- layout_style_radio = gr.Radio(
168
- ["stacked", "two-column"], label="Layout Style", value="stacked",
169
- info="How to display titles and names."
170
- )
171
- swap_sizes_checkbox = gr.Checkbox(
172
- label="Swap Title/Name Font Sizes", value=False,
173
- info="Emphasize name over title in two-column layout.",
174
- visible=False
175
- )
176
- title_uppercase_checkbox = gr.Checkbox(label="Title Uppercase", value=False)
177
- name_uppercase_checkbox = gr.Checkbox(label="Name Uppercase", value=False)
178
- section_title_uppercase_checkbox = gr.Checkbox(label="Section Uppercase", value=True)
179
-
180
- gr.Markdown("### Scrolling Logo")
181
- show_scroll_logo_checkbox = gr.Checkbox(
182
- label="Show Logo in Credits Roll",
183
- value=True,
184
- info="Toggles the logo above the intro text."
185
- )
186
- scroll_logo_height_input = gr.Textbox(label="Scrolling Logo Height", value="100px")
187
-
188
- gr.Markdown("### Intro Text")
189
- intro_title_input = gr.Textbox(label="Intro Title", value="Gradio")
190
- intro_subtitle_input = gr.Textbox(label="Intro Subtitle", value="The best UI framework")
191
-
192
- gr.Markdown("### Layout & Visibility")
193
- sidebar_position_radio = gr.Radio(["right", "bottom"], label="Sidebar Position", value="right")
194
- show_logo_checkbox = gr.Checkbox(label="Show Logo", value=True)
195
- show_licenses_checkbox = gr.Checkbox(label="Show Licenses", value=True)
196
- show_credits_checkbox = gr.Checkbox(label="Show Credits", value=True)
197
-
198
- gr.Markdown("### Logo Customization")
199
- logo_position_radio = gr.Radio(["left", "center", "right"], label="Logo Position", value="center")
200
- logo_sizing_radio = gr.Radio(["stretch", "crop", "resize"], label="Logo Sizing", value="resize")
201
- logo_width_input = gr.Textbox(label="Logo Width", value="200px")
202
- logo_height_input = gr.Textbox(label="Logo Height", value="100px")
203
-
204
- gr.Markdown("### Color Settings (Scroll Effect)")
205
- scroll_background_color = gr.ColorPicker(label="Background Color", value="#000000")
206
- scroll_title_color = gr.ColorPicker(label="Title Color", value="#FFFFFF")
207
- scroll_section_title_color = gr.ColorPicker(label="Section Title Color", value="#FFFFFF")
208
- scroll_name_color = gr.ColorPicker(label="Name Color", value="#FFFFFF")
209
-
210
- panel = CreditsPanel(
211
- height=500,
212
- credits=credits_list,
213
- licenses=license_paths,
214
- effect="scroll",
215
- speed=DEFAULT_SPEEDS["scroll"],
216
- base_font_size=1.5,
217
- intro_title="Gradio",
218
- intro_subtitle="The best UI framework",
219
- sidebar_position="right",
220
- logo_path=LOGO_PATH,
221
- show_logo=True,
222
- show_licenses=True,
223
- show_credits=True,
224
- logo_position="center",
225
- logo_sizing="resize",
226
- logo_width="200px",
227
- logo_height="100px",
228
- scroll_background_color="#000000",
229
- scroll_title_color="#FFFFFF",
230
- scroll_name_color="#FFFFFF",
231
- scroll_section_title_color="#FFFFFF",
232
- layout_style="stacked",
233
- title_uppercase=False,
234
- name_uppercase=False,
235
- section_title_uppercase=True,
236
- swap_font_sizes_on_two_column=False,
237
- scroll_logo_path=SCROLL_LOGO_PATH,
238
- scroll_logo_height="100px",
239
- )
240
-
241
- inputs = [
242
- effect_radio,
243
- speed_slider,
244
- font_size_slider,
245
- intro_title_input,
246
- intro_subtitle_input,
247
- sidebar_position_radio,
248
- show_logo_checkbox,
249
- show_licenses_checkbox,
250
- show_credits_checkbox,
251
- logo_position_radio,
252
- logo_sizing_radio,
253
- logo_width_input,
254
- logo_height_input,
255
- scroll_background_color,
256
- scroll_title_color,
257
- scroll_section_title_color,
258
- scroll_name_color,
259
- layout_style_radio,
260
- title_uppercase_checkbox,
261
- name_uppercase_checkbox,
262
- section_title_uppercase_checkbox,
263
- swap_sizes_checkbox,
264
- show_scroll_logo_checkbox,
265
- scroll_logo_height_input
266
- ]
267
-
268
- demo.load(
269
- fn=update_panel,
270
- inputs=inputs,
271
- outputs=panel
272
- )
273
- layout_style_radio.change(
274
- fn=toggle_swap_checkbox_visibility,
275
- inputs=layout_style_radio,
276
- outputs=swap_sizes_checkbox
277
- )
278
- effect_radio.change(fn=update_ui_on_effect_change, inputs=effect_radio, outputs=[speed_slider, font_size_slider])
279
-
280
- for input_component in inputs:
281
- input_component.change(fn=update_panel, inputs=inputs, outputs=panel)
282
-
283
- if __name__ == "__main__":
284
- setup_demo_files()
285
  demo.launch()
 
1
+ # app.py
2
+
3
+ import gradio as gr
4
+ from gradio_creditspanel import CreditsPanel
5
+ import os
6
+
7
+ def setup_demo_files():
8
+ """Creates necessary directories and dummy files for the demo."""
9
+ os.makedirs("src/LICENSES", exist_ok=True)
10
+ if not os.path.exists("src/LICENSES/Apache.txt"):
11
+ with open("src/LICENSES/Apache.txt", "w") as f:
12
+ f.write("Apache License\nVersion 2.0, January 2004...")
13
+ if not os.path.exists("src/LICENSES/MIT.txt"):
14
+ with open("src/LICENSES/MIT.txt", "w") as f:
15
+ f.write("src/MIT License\nCopyright (c) 2025 Author...")
16
+
17
+ md_content = ""
18
+ if not os.path.exists("src/LICENSES/Component_License.md"):
19
+ md_content = """
20
+ # Component License (Markdown)
21
+
22
+ This is a sample license file written in **Markdown** to demonstrate rendering capabilities.
23
+
24
+ ## Key Points
25
+ - You are free to use this component in your projects.
26
+ - Attribution is appreciated but not required.
27
+ - The component is provided *as-is*, without warranty.
28
+
29
+ ## More Information
30
+ For more details, please visit the [Gradio website](https://www.gradio.app).
31
+
32
+ ```python
33
+ print("Hello, Gradio!")
34
+ ```
35
+ """
36
+ with open("src/LICENSES/Component_License.md", "w") as f:
37
+ f.write(md_content)
38
+
39
+ os.makedirs("assets", exist_ok=True)
40
+ if not os.path.exists("./src/assets/logo.webp"):
41
+ with open("./src/assets/logo.webp", "w") as f:
42
+ f.write("Placeholder WebP logo")
43
+
44
+ # --- Credits list with sections ---
45
+ credits_list = [
46
+ {"section_title": "Project Leadership"},
47
+ {"title": "Project Manager", "name": "Emma Thompson"},
48
+ {"title": "Scrum Master", "name": "Ava Rodriguez"},
49
+
50
+ {"section_title": "Development Team"},
51
+ {"title": "Lead Developer", "name": "John Doe"},
52
+ {"title": "Senior Backend Engineer", "name": "Michael Chen"},
53
+ {"title": "Frontend Developer", "name": "Sarah Johnson"},
54
+ {"title": "UI/UX Designer", "name": "Jane Smith"},
55
+ {"title": "Database Architect", "name": "Alex Ray"},
56
+
57
+ {"section_title": "Quality & Operations"},
58
+ {"title": "DevOps Engineer", "name": "Liam Patel"},
59
+ {"title": "Quality Assurance Lead", "name": "Sam Wilson"},
60
+ {"title": "Test Automation Engineer", "name": "Olivia Brown"},
61
+ ]
62
+
63
+ license_paths = {
64
+ "Gradio Framework": "./src/LICENSES/Apache.txt",
65
+ "This Component": "./src/LICENSES/MIT.txt",
66
+ "(MD) File Example": "./src/LICENSES/Component_License.md"
67
+ }
68
+
69
+ DEFAULT_SPEEDS = {
70
+ "scroll": 40.0,
71
+ "starwars": 70.0,
72
+ "matrix": 40.0
73
+ }
74
+ SCROLL_LOGO_PATH = "./src/assets/gradio_logo_white.png"
75
+ LOGO_PATH="./src/assets/logo.webp"
76
+
77
+ def update_panel(
78
+ effect: str,
79
+ speed: float,
80
+ base_font_size: float,
81
+ intro_title: str,
82
+ intro_subtitle: str,
83
+ sidebar_position: str,
84
+ show_logo: bool,
85
+ show_licenses: bool,
86
+ show_credits: bool,
87
+ logo_position: str,
88
+ logo_sizing: str,
89
+ logo_width: str | None,
90
+ logo_height: str | None,
91
+ scroll_background_color: str | None,
92
+ scroll_title_color: str | None,
93
+ scroll_section_title_color: str | None,
94
+ scroll_name_color: str | None,
95
+ layout_style: str,
96
+ title_uppercase: bool,
97
+ name_uppercase: bool,
98
+ section_title_uppercase: bool,
99
+ swap_font_sizes: bool,
100
+ show_scroll_logo: bool,
101
+ scroll_logo_height: str | None
102
+ ) -> dict:
103
+ """Callback function that updates all properties of the CreditsPanel component."""
104
+
105
+ scroll_logo_path = SCROLL_LOGO_PATH if show_scroll_logo else None
106
+
107
+ if not scroll_logo_height:
108
+ scroll_logo_height = "120px"
109
+
110
+ return {
111
+ "credits": credits_list,
112
+ "licenses": license_paths,
113
+ "effect": effect,
114
+ "speed": speed,
115
+ "base_font_size": base_font_size,
116
+ "intro_title": intro_title,
117
+ "intro_subtitle": intro_subtitle,
118
+ "sidebar_position": sidebar_position,
119
+ "logo_path": LOGO_PATH,
120
+ "show_logo": show_logo,
121
+ "show_licenses": show_licenses,
122
+ "show_credits": show_credits,
123
+ "logo_position": logo_position,
124
+ "logo_sizing": logo_sizing,
125
+ "logo_width": logo_width,
126
+ "logo_height": logo_height,
127
+ "scroll_background_color": scroll_background_color,
128
+ "scroll_title_color": scroll_title_color,
129
+ "scroll_name_color": scroll_name_color,
130
+ "scroll_section_title_color": scroll_section_title_color,
131
+ "layout_style": layout_style,
132
+ "title_uppercase": title_uppercase,
133
+ "name_uppercase": name_uppercase,
134
+ "section_title_uppercase": section_title_uppercase,
135
+ "swap_font_sizes_on_two_column": swap_font_sizes,
136
+ "scroll_logo_path": scroll_logo_path,
137
+ "scroll_logo_height": scroll_logo_height,
138
+ }
139
+
140
+ def update_ui_on_effect_change(effect: str) -> tuple[float, float]:
141
+ """Updates sliders to sensible defaults when the animation effect is changed."""
142
+ font_size = 1.5
143
+ if effect == "starwars":
144
+ font_size = 3.8
145
+ speed = DEFAULT_SPEEDS.get(effect, 40.0)
146
+ return speed, font_size
147
+
148
+ def toggle_swap_checkbox_visibility(layout: str) -> dict:
149
+ """Show the swap checkbox only for the two-column layout."""
150
+ return gr.update(visible=(layout == 'two-column'))
151
+
152
+ with gr.Blocks(theme=gr.themes.Ocean(), title="CreditsPanel Demo") as demo:
153
+ gr.Markdown(
154
+ """
155
+ # Interactive CreditsPanel Demo
156
+ Use the sidebar controls to customize the `CreditsPanel` component in real-time.
157
+ """
158
+ )
159
+
160
+ with gr.Sidebar(position="right"):
161
+ gr.Markdown("### Effects Settings")
162
+ effect_radio = gr.Radio(["scroll", "starwars", "matrix"], label="Animation Effect", value="scroll")
163
+ speed_slider = gr.Slider(minimum=5.0, maximum=100.0, step=1.0, value=DEFAULT_SPEEDS["scroll"], label="Animation Speed")
164
+ font_size_slider = gr.Slider(minimum=1.0, maximum=10.0, step=0.1, value=1.5, label="Base Font Size")
165
+
166
+ gr.Markdown("### Credits Layout Settings")
167
+ layout_style_radio = gr.Radio(
168
+ ["stacked", "two-column"], label="Layout Style", value="stacked",
169
+ info="How to display titles and names."
170
+ )
171
+ swap_sizes_checkbox = gr.Checkbox(
172
+ label="Swap Title/Name Font Sizes", value=False,
173
+ info="Emphasize name over title in two-column layout.",
174
+ visible=False
175
+ )
176
+ title_uppercase_checkbox = gr.Checkbox(label="Title Uppercase", value=False)
177
+ name_uppercase_checkbox = gr.Checkbox(label="Name Uppercase", value=False)
178
+ section_title_uppercase_checkbox = gr.Checkbox(label="Section Uppercase", value=True)
179
+
180
+ gr.Markdown("### Scrolling Logo")
181
+ show_scroll_logo_checkbox = gr.Checkbox(
182
+ label="Show Logo in Credits Roll",
183
+ value=True,
184
+ info="Toggles the logo above the intro text."
185
+ )
186
+ scroll_logo_height_input = gr.Textbox(label="Scrolling Logo Height", value="100px")
187
+
188
+ gr.Markdown("### Intro Text")
189
+ intro_title_input = gr.Textbox(label="Intro Title", value="Gradio")
190
+ intro_subtitle_input = gr.Textbox(label="Intro Subtitle", value="The best UI framework")
191
+
192
+ gr.Markdown("### Layout & Visibility")
193
+ sidebar_position_radio = gr.Radio(["right", "bottom"], label="Sidebar Position", value="right")
194
+ show_logo_checkbox = gr.Checkbox(label="Show Logo", value=True)
195
+ show_licenses_checkbox = gr.Checkbox(label="Show Licenses", value=True)
196
+ show_credits_checkbox = gr.Checkbox(label="Show Credits", value=True)
197
+
198
+ gr.Markdown("### Logo Customization")
199
+ logo_position_radio = gr.Radio(["left", "center", "right"], label="Logo Position", value="center")
200
+ logo_sizing_radio = gr.Radio(["stretch", "crop", "resize"], label="Logo Sizing", value="resize")
201
+ logo_width_input = gr.Textbox(label="Logo Width", value="200px")
202
+ logo_height_input = gr.Textbox(label="Logo Height", value="100px")
203
+
204
+ gr.Markdown("### Color Settings (Scroll Effect)")
205
+ scroll_background_color = gr.ColorPicker(label="Background Color", value="#000000")
206
+ scroll_title_color = gr.ColorPicker(label="Title Color", value="#FFFFFF")
207
+ scroll_section_title_color = gr.ColorPicker(label="Section Title Color", value="#FFFFFF")
208
+ scroll_name_color = gr.ColorPicker(label="Name Color", value="#FFFFFF")
209
+
210
+ panel = CreditsPanel(
211
+ height=500,
212
+ credits=credits_list,
213
+ licenses=license_paths,
214
+ effect="scroll",
215
+ speed=DEFAULT_SPEEDS["scroll"],
216
+ base_font_size=1.5,
217
+ intro_title="Gradio",
218
+ intro_subtitle="The best UI framework",
219
+ sidebar_position="right",
220
+ logo_path=LOGO_PATH,
221
+ show_logo=True,
222
+ show_licenses=True,
223
+ show_credits=True,
224
+ logo_position="center",
225
+ logo_sizing="resize",
226
+ logo_width="200px",
227
+ logo_height="100px",
228
+ scroll_background_color="#000000",
229
+ scroll_title_color="#FFFFFF",
230
+ scroll_name_color="#FFFFFF",
231
+ scroll_section_title_color="#FFFFFF",
232
+ layout_style="stacked",
233
+ title_uppercase=False,
234
+ name_uppercase=False,
235
+ section_title_uppercase=True,
236
+ swap_font_sizes_on_two_column=False,
237
+ scroll_logo_path=SCROLL_LOGO_PATH,
238
+ scroll_logo_height="100px",
239
+ )
240
+
241
+ inputs = [
242
+ effect_radio,
243
+ speed_slider,
244
+ font_size_slider,
245
+ intro_title_input,
246
+ intro_subtitle_input,
247
+ sidebar_position_radio,
248
+ show_logo_checkbox,
249
+ show_licenses_checkbox,
250
+ show_credits_checkbox,
251
+ logo_position_radio,
252
+ logo_sizing_radio,
253
+ logo_width_input,
254
+ logo_height_input,
255
+ scroll_background_color,
256
+ scroll_title_color,
257
+ scroll_section_title_color,
258
+ scroll_name_color,
259
+ layout_style_radio,
260
+ title_uppercase_checkbox,
261
+ name_uppercase_checkbox,
262
+ section_title_uppercase_checkbox,
263
+ swap_sizes_checkbox,
264
+ show_scroll_logo_checkbox,
265
+ scroll_logo_height_input
266
+ ]
267
+
268
+ demo.load(
269
+ fn=update_panel,
270
+ inputs=inputs,
271
+ outputs=panel
272
+ )
273
+ layout_style_radio.change(
274
+ fn=toggle_swap_checkbox_visibility,
275
+ inputs=layout_style_radio,
276
+ outputs=swap_sizes_checkbox
277
+ )
278
+ effect_radio.change(fn=update_ui_on_effect_change, inputs=effect_radio, outputs=[speed_slider, font_size_slider])
279
+
280
+ for input_component in inputs:
281
+ input_component.change(fn=update_panel, inputs=inputs, outputs=panel)
282
+
283
+ if __name__ == "__main__":
284
+ setup_demo_files()
285
  demo.launch()