Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,40 @@ app_state = {"components": []}
|
|
43 |
|
44 |
terminal_history = ""
|
45 |
#--- Component Library ---
|
46 |
-
components_registry = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
#--- NLP Model (Example using Hugging Face) ---
|
49 |
nlp_model_names = [
|
|
|
43 |
|
44 |
terminal_history = ""
|
45 |
#--- Component Library ---
|
46 |
+
components_registry = {
|
47 |
+
"Button": {
|
48 |
+
"properties": {
|
49 |
+
"label": "Click Me",
|
50 |
+
"onclick": ""
|
51 |
+
},
|
52 |
+
"description": "A clickable button",
|
53 |
+
"code_snippet": "gr.Button(value='{{label}}', variant='primary')"
|
54 |
+
},
|
55 |
+
"Text Input": {
|
56 |
+
"properties": {
|
57 |
+
"value": "",
|
58 |
+
"placeholder": "Enter text"
|
59 |
+
},
|
60 |
+
"description": "A field for entering text",
|
61 |
+
"code_snippet": "gr.Textbox(label='{{placeholder}}')"
|
62 |
+
},
|
63 |
+
"Image": {
|
64 |
+
"properties": {
|
65 |
+
"src": "#",
|
66 |
+
"alt": "Image"
|
67 |
+
},
|
68 |
+
"description": "Displays an image",
|
69 |
+
"code_snippet": "gr.Image(label='{{alt}}')"
|
70 |
+
},
|
71 |
+
"Dropdown": {
|
72 |
+
"properties": {
|
73 |
+
"choices": ["Option 1", "Option 2"],
|
74 |
+
"value": ""
|
75 |
+
},
|
76 |
+
"description": "A dropdown menu for selecting options",
|
77 |
+
"code_snippet": "gr.Dropdown(choices={{choices}}, label='Dropdown')"
|
78 |
+
}
|
79 |
+
}
|
80 |
|
81 |
#--- NLP Model (Example using Hugging Face) ---
|
82 |
nlp_model_names = [
|