acecalisto3 commited on
Commit
ef1426a
·
verified ·
1 Parent(s): 4cbab65

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -1
app.py CHANGED
@@ -43,7 +43,40 @@ app_state = {"components": []}
43
 
44
  terminal_history = ""
45
  #--- Component Library ---
46
- components_registry = { "Button": { "properties": {"label": "Click Me", "onclick": ""}, "description": "A clickable button", "code_snippet": 'gr.Button(value="{label}", variant="primary")', }, "Text Input": { "properties": {"value": "", "placeholder": "Enter text"}, "description": "A field for entering text", "code_snippet": 'gr.Textbox(label="{placeholder}")', }, "Image": { "properties": {"src": "#", "alt": "Image"}, "description": "Displays an image", "code_snippet": 'gr.Image(label="{alt}")', }, "Dropdown": { "properties": {"choices": ["Option 1", "Option 2"], "value": ""}, "description": "A dropdown menu for selecting options", "code_snippet": 'gr.Dropdown(choices={choices}, label="Dropdown")'}, # Add more components here... }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 = [