Campfireman commited on
Commit
c1552b6
1 Parent(s): b60cf63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -28,13 +28,12 @@ def titanic(pclass,sex,age,sibsp,parch,embarked,fare_per_customer,embarked_remap
28
  # 'res' is a list of predictions returned as the label.
29
  #global res
30
  res = model.predict(np.asarray(input_list).reshape(1, -1))
31
- return {('This guy will' + ('survive. ' if float(res[0])==1 else 'die. '))}
32
 
33
  demo = gr.Interface(
34
  titanic,
35
  title="Titanic Predictive Analytics",
36
  description="Predict survivals. 0 for dead and 1 for survived. ",
37
- allow_flagging="never",
38
  inputs=[
39
  gr.inputs.Number(default=1.0, label="pclass"),
40
  gr.inputs.Number(default=1.0, label="gender(male=0, female=1)"),
@@ -45,7 +44,7 @@ demo = gr.Interface(
45
  gr.inputs.Number(default=1.0, label="fare_per_customer"),
46
  gr.inputs.Number(default=1.0, label="cabin(if the passanger has one cabin =1, else =0)"),
47
  ],
48
- outputs=gr.Textbox(type="auto")
49
  )
50
  # outputs=gr.outputs.Textbox(self,type="auto",label="Hi"))
51
  #("This guy will"+("survive. " if res[0]==1 else "die. ")
 
28
  # 'res' is a list of predictions returned as the label.
29
  #global res
30
  res = model.predict(np.asarray(input_list).reshape(1, -1))
31
+ return {('This guy will')}
32
 
33
  demo = gr.Interface(
34
  titanic,
35
  title="Titanic Predictive Analytics",
36
  description="Predict survivals. 0 for dead and 1 for survived. ",
 
37
  inputs=[
38
  gr.inputs.Number(default=1.0, label="pclass"),
39
  gr.inputs.Number(default=1.0, label="gender(male=0, female=1)"),
 
44
  gr.inputs.Number(default=1.0, label="fare_per_customer"),
45
  gr.inputs.Number(default=1.0, label="cabin(if the passanger has one cabin =1, else =0)"),
46
  ],
47
+ outputs=gr.Textbox()
48
  )
49
  # outputs=gr.outputs.Textbox(self,type="auto",label="Hi"))
50
  #("This guy will"+("survive. " if res[0]==1 else "die. ")