Spaces:
Runtime error
Runtime error
Quick fix
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ def titanic(Sex, Age, Pclass, Fare, Parch, SibSp, Embarked):
|
|
29 |
res = model.predict(np.asarray(input_list).reshape(1, -1))
|
30 |
# We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
|
31 |
# the first element.
|
32 |
-
pic_url = "https://raw.githubusercontent.com/backgroundhumeur/id2223_labs/main/src/titanic/assets/titanic_" + res[0] + ".jpg"
|
33 |
img = Image.open(requests.get(pic_url, stream=True).raw)
|
34 |
return img
|
35 |
|
@@ -45,7 +45,7 @@ demo = gr.Interface(
|
|
45 |
gr.inputs.Number(default=14.4542, label="Fare ($)"),
|
46 |
gr.inputs.Number(default=0.0, label="Number of parents/children aboard"),
|
47 |
gr.inputs.Number(default=0.0, label="Number of siblings/spouses aboard"),
|
48 |
-
gr.inputs.Dropdown(choices=["S","C", "Q"],type='index', default="
|
49 |
],
|
50 |
outputs=gr.Image(type="pil"))
|
51 |
|
|
|
29 |
res = model.predict(np.asarray(input_list).reshape(1, -1))
|
30 |
# We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
|
31 |
# the first element.
|
32 |
+
pic_url = "https://raw.githubusercontent.com/backgroundhumeur/id2223_labs/main/src/titanic/assets/titanic_" + str(res[0]) + ".jpg"
|
33 |
img = Image.open(requests.get(pic_url, stream=True).raw)
|
34 |
return img
|
35 |
|
|
|
45 |
gr.inputs.Number(default=14.4542, label="Fare ($)"),
|
46 |
gr.inputs.Number(default=0.0, label="Number of parents/children aboard"),
|
47 |
gr.inputs.Number(default=0.0, label="Number of siblings/spouses aboard"),
|
48 |
+
gr.inputs.Dropdown(choices=["S","C", "Q"],type='index', default="S", label="Port of Embarkation")
|
49 |
],
|
50 |
outputs=gr.Image(type="pil"))
|
51 |
|