Spaces:
Sleeping
Sleeping
Isabel Gwara
commited on
Commit
·
6ba2cf2
1
Parent(s):
54e9b20
Update app.py
Browse files
app.py
CHANGED
|
@@ -130,11 +130,13 @@ with open('info.md') as f:
|
|
| 130 |
with gr.Row():
|
| 131 |
with gr.Box():
|
| 132 |
inputls = []
|
| 133 |
-
for colname in data.columns:
|
| 134 |
# skip last column
|
| 135 |
if colname == final_colname:
|
| 136 |
continue
|
| 137 |
-
|
|
|
|
|
|
|
| 138 |
# access categories dict if data is categorical
|
| 139 |
# otherwise, just use a number input
|
| 140 |
if colname in cat_value_dicts:
|
|
@@ -143,10 +145,11 @@ with open('info.md') as f:
|
|
| 143 |
else:
|
| 144 |
# add numerical input
|
| 145 |
inputls.append(gr.inputs.Number(label=colname))
|
| 146 |
-
|
| 147 |
-
|
| 148 |
output = gr.Textbox(label="Your recommendation:")
|
| 149 |
-
|
|
|
|
| 150 |
|
| 151 |
submit = gr.Button("Submit", variant="primary")
|
| 152 |
submit.click(fn=general_predictor, inputs=inputls, outputs=output)
|
|
|
|
| 130 |
with gr.Row():
|
| 131 |
with gr.Box():
|
| 132 |
inputls = []
|
| 133 |
+
for num, colname in enumerate(data.columns):
|
| 134 |
# skip last column
|
| 135 |
if colname == final_colname:
|
| 136 |
continue
|
| 137 |
+
|
| 138 |
+
gr.Markdown("##Question " + (num + 1))
|
| 139 |
+
|
| 140 |
# access categories dict if data is categorical
|
| 141 |
# otherwise, just use a number input
|
| 142 |
if colname in cat_value_dicts:
|
|
|
|
| 145 |
else:
|
| 146 |
# add numerical input
|
| 147 |
inputls.append(gr.inputs.Number(label=colname))
|
| 148 |
+
|
| 149 |
+
gr.Markdown("##Output ⤵️⤵️")
|
| 150 |
output = gr.Textbox(label="Your recommendation:")
|
| 151 |
+
|
| 152 |
+
gr.Markdown("##⤵️⤵️")
|
| 153 |
|
| 154 |
submit = gr.Button("Submit", variant="primary")
|
| 155 |
submit.click(fn=general_predictor, inputs=inputls, outputs=output)
|