Spaces:
Running
Running
milwright
commited on
Commit
·
4ce68d1
1
Parent(s):
ada948c
add language learner template and test themes functionality
Browse files- space_template.py +0 -1
- test_themes.py +26 -0
space_template.py
CHANGED
@@ -34,7 +34,6 @@ DEFAULT_CONFIG = {{
|
|
34 |
'enable_dynamic_urls': {enable_dynamic_urls},
|
35 |
'enable_file_upload': {enable_file_upload},
|
36 |
'examples': {examples},
|
37 |
-
'language': {language},
|
38 |
'locked': False
|
39 |
}}
|
40 |
|
|
|
34 |
'enable_dynamic_urls': {enable_dynamic_urls},
|
35 |
'enable_file_upload': {enable_file_upload},
|
36 |
'examples': {examples},
|
|
|
37 |
'locked': False
|
38 |
}}
|
39 |
|
test_themes.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Test theme dropdown functionality"""
|
2 |
+
import gradio as gr
|
3 |
+
from utils import AVAILABLE_THEMES
|
4 |
+
|
5 |
+
print("Available themes:", list(AVAILABLE_THEMES.keys()))
|
6 |
+
|
7 |
+
with gr.Blocks() as demo:
|
8 |
+
gr.Markdown("# Theme Dropdown Test")
|
9 |
+
|
10 |
+
theme_dropdown = gr.Dropdown(
|
11 |
+
label="Select Theme",
|
12 |
+
choices=list(AVAILABLE_THEMES.keys()),
|
13 |
+
value="Default",
|
14 |
+
interactive=True
|
15 |
+
)
|
16 |
+
|
17 |
+
output = gr.Textbox(label="Selected Theme")
|
18 |
+
|
19 |
+
theme_dropdown.change(
|
20 |
+
lambda x: f"You selected: {x}",
|
21 |
+
inputs=[theme_dropdown],
|
22 |
+
outputs=[output]
|
23 |
+
)
|
24 |
+
|
25 |
+
if __name__ == "__main__":
|
26 |
+
demo.launch()
|