tlord commited on
Commit
4a8b274
1 Parent(s): 9edefe7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -35,8 +35,8 @@ def titanic(ticket_class, sex, port, fare, age, sibsp, parch):
35
  input_list.append(PORT_TO_VALUE[port])
36
  input_list.append(fare)
37
  input_list.append(age)
38
- input_list.append(sibsp)
39
- input_list.append(parch)
40
  # 'res' is a list of predictions returned as the label.
41
  res = model.predict(np.asarray(input_list).reshape(1, -1))
42
  # We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
@@ -61,8 +61,8 @@ demo = gr.Interface(
61
  gr.inputs.Dropdown(["Cherbourg", "Queenstown", "Southampton"], label="Port of Embarkation"),
62
  gr.inputs.Number(default=50.0, label="Fare"),
63
  gr.inputs.Number(default=20.0, label="Age"),
64
- gr.inputs.Number(default=0, precision=0, label="Number of siblings/spouses aboard the Titanic"),
65
- gr.inputs.Number(default=0, precision=0, label="Number of parents/children aboard the Titanic"),
66
  ],
67
  outputs=gr.Image(type="pil"))
68
 
 
35
  input_list.append(PORT_TO_VALUE[port])
36
  input_list.append(fare)
37
  input_list.append(age)
38
+ input_list.append(int(sibsp))
39
+ input_list.append(int(parch))
40
  # 'res' is a list of predictions returned as the label.
41
  res = model.predict(np.asarray(input_list).reshape(1, -1))
42
  # We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
 
61
  gr.inputs.Dropdown(["Cherbourg", "Queenstown", "Southampton"], label="Port of Embarkation"),
62
  gr.inputs.Number(default=50.0, label="Fare"),
63
  gr.inputs.Number(default=20.0, label="Age"),
64
+ gr.inputs.Number(default=0, label="Number of siblings/spouses aboard the Titanic"),
65
+ gr.inputs.Number(default=0, label="Number of parents/children aboard the Titanic"),
66
  ],
67
  outputs=gr.Image(type="pil"))
68