johnpaulbin commited on
Commit
aace1e6
·
verified ·
1 Parent(s): 3a15783

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -15
app.py CHANGED
@@ -142,26 +142,24 @@ def create_interface():
142
  gr.Markdown("Please rate the following statements on a scale from **1 (Disagree a lot)** to **5 (Agree a lot)**. If you prefer not to respond to a particular statement, select **'No response'**.")
143
 
144
  # Create a grid layout for better organization
145
- with gr.Row():
146
- with gr.Column(scale=1):
147
- pass # Empty column for spacing
148
- with gr.Column(scale=10):
149
- dropdowns = []
150
- for q in questions:
151
- dropdown = gr.Dropdown(
152
- choices=["No response", 1, 2, 3, 4, 5],
153
- label=q,
154
- value="No response"
155
- )
156
- dropdowns.append(dropdown)
157
 
158
  # Submit button
159
  submit_btn = gr.Button("Submit")
160
- submit_btn.click(compute_bfi_scores, inputs=dropdowns, outputs="result")
161
-
162
  # Results display
163
  result = gr.Markdown()
164
- demo.add_component(result, "result")
 
 
165
 
166
  return demo
167
 
 
142
  gr.Markdown("Please rate the following statements on a scale from **1 (Disagree a lot)** to **5 (Agree a lot)**. If you prefer not to respond to a particular statement, select **'No response'**.")
143
 
144
  # Create a grid layout for better organization
145
+ with gr.Column():
146
+ dropdowns = []
147
+ for q in questions:
148
+ dropdown = gr.Dropdown(
149
+ choices=["No response", 1, 2, 3, 4, 5],
150
+ label=q,
151
+ value="No response"
152
+ )
153
+ dropdowns.append(dropdown)
 
 
 
154
 
155
  # Submit button
156
  submit_btn = gr.Button("Submit")
157
+
 
158
  # Results display
159
  result = gr.Markdown()
160
+
161
+ # Link the button to the function
162
+ submit_btn.click(fn=compute_bfi_scores, inputs=dropdowns, outputs=result)
163
 
164
  return demo
165