CsanadT commited on
Commit
865abe0
1 Parent(s): 30bda2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -10,7 +10,7 @@ fs = project.get_feature_store()
10
 
11
 
12
  mr = project.get_model_registry()
13
- model = mr.get_model("titanic_modal", version=3)
14
  model_dir = model.download()
15
  model = joblib.load(model_dir + "/titanic_model.pkl")
16
 
@@ -26,9 +26,9 @@ def titanic(age, sex, pclass, fare):
26
  # We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
27
  # the first element.
28
  if res == 0:
29
- output = "This individual probably survived the crash."
30
  else:
31
- output = "This individual unfortunately probably did not survive the crash."
32
  return output
33
 
34
  demo = gr.Interface(
@@ -40,7 +40,7 @@ demo = gr.Interface(
40
  gr.inputs.Number(default=30.0, label=" Age "),
41
  gr.inputs.Number(default=1, label=" Sex (0 = Female, 1 = Male) "),
42
  gr.inputs.Number(default=2, label=" Ticket class (1 = first, 2 = second, 3 = third) "),
43
- gr.inputs.Number(default=1.0, label=" Passenger fare ()"),
44
  ],
45
  outputs=gr.outputs.Textbox(label='Prediction'))
46
 
 
10
 
11
 
12
  mr = project.get_model_registry()
13
+ model = mr.get_model("titanic_modal", version=5)
14
  model_dir = model.download()
15
  model = joblib.load(model_dir + "/titanic_model.pkl")
16
 
 
26
  # We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
27
  # the first element.
28
  if res == 0:
29
+ output = "This individual probably survived the Titanic."
30
  else:
31
+ output = "This individual unfortunately probably did not survive the Titanic."
32
  return output
33
 
34
  demo = gr.Interface(
 
40
  gr.inputs.Number(default=30.0, label=" Age "),
41
  gr.inputs.Number(default=1, label=" Sex (0 = Female, 1 = Male) "),
42
  gr.inputs.Number(default=2, label=" Ticket class (1 = first, 2 = second, 3 = third) "),
43
+ gr.inputs.Number(default=1.0, label=" Passenger fare (Positive real number)"),
44
  ],
45
  outputs=gr.outputs.Textbox(label='Prediction'))
46