Isabel Gwara commited on
Commit
6b53e3b
·
1 Parent(s): a5b4e81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -19
app.py CHANGED
@@ -127,25 +127,32 @@ with open('info.md') as f:
127
  gr.Markdown("###" + f.readline())
128
  gr.Markdown('Take the quiz to get a personalized recommendation using AI.')
129
 
130
- inputls = []
131
- for colname in data.columns:
132
- # skip last column
133
- if colname == final_colname:
134
- continue
135
-
136
- # access categories dict if data is categorical
137
- # otherwise, just use a number input
138
- if colname in cat_value_dicts:
139
- radio_options = list(cat_value_dicts[colname].keys())
140
- inputls.append(gr.inputs.Dropdown(choices=radio_options, type="value", label=colname))
141
- else:
142
- # add numerical input
143
- inputls.append(gr.inputs.Number(label=colname))
144
-
145
- output = gr.Text()
146
-
147
- submit = gr.Button("Submit")
148
- submit.click(fn=general_predictor, inputs=inputls, outputs=output)
 
 
 
 
 
 
 
149
 
150
  # show the interface
151
  block.launch()
 
127
  gr.Markdown("###" + f.readline())
128
  gr.Markdown('Take the quiz to get a personalized recommendation using AI.')
129
 
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:
141
+ radio_options = list(cat_value_dicts[colname].keys())
142
+ inputls.append(gr.inputs.Dropdown(choices=radio_options, type="value", label=colname))
143
+ else:
144
+ # add numerical input
145
+ inputls.append(gr.inputs.Number(label=colname))
146
+
147
+ output = gr.Text()
148
+
149
+ submit = gr.Button("Submit")
150
+ submit.click(fn=general_predictor, inputs=inputls, outputs=output)
151
+
152
+ with gr.Box():
153
+ with open('info.md') as f:
154
+ f.readline()
155
+ gr.Markdown(f.read())
156
 
157
  # show the interface
158
  block.launch()