slickdata commited on
Commit
72d8935
·
1 Parent(s): f46dec4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -3,10 +3,9 @@ import numpy as np
3
  import gradio as gr
4
  import joblib
5
  import pandas as pd
6
- import itertools
7
  import os
8
 
9
- from gradio.components import Dropdown, Number, Textbox
10
 
11
  def load_model():
12
  cwd = os.getcwd()
@@ -75,15 +74,13 @@ input_col2 = [Number(),
75
  Number(),
76
  Number()]
77
 
78
- def flatten(list_of_lists):
79
- return itertools.chain.from_iterable(list_of_lists)
80
-
81
- inputs = flatten([input_col1, input_col2])
82
-
83
  output = Textbox(label='Prediction')
84
 
 
 
 
85
  # Create the interface component
86
- app = gr.Interface(fn=make_prediction, inputs=[input_col1, input_col2],
87
  title="Customer Churn Predictor",
88
  description="Enter the fields below and click the submit button to Make Your Prediction",
89
  outputs=output)
 
3
  import gradio as gr
4
  import joblib
5
  import pandas as pd
 
6
  import os
7
 
8
+ from gradio.components import Dropdown, Number, Textbox, Column
9
 
10
  def load_model():
11
  cwd = os.getcwd()
 
74
  Number(),
75
  Number()]
76
 
 
 
 
 
 
77
  output = Textbox(label='Prediction')
78
 
79
+ # Wrap the input components in a Column component
80
+ inputs = Column(children=[input_col1, input_col2])
81
+
82
  # Create the interface component
83
+ app = gr.Interface(fn=make_prediction, inputs=inputs,
84
  title="Customer Churn Predictor",
85
  description="Enter the fields below and click the submit button to Make Your Prediction",
86
  outputs=output)