Spaces:
Runtime error
Runtime error
matteocirca
commited on
Commit
·
43bc678
1
Parent(s):
faf3252
Update app
Browse files
app.py
CHANGED
@@ -15,10 +15,10 @@ model_dir = model.download()
|
|
15 |
model = joblib.load(model_dir + "/wine_model.pkl")
|
16 |
print("Model downloaded")
|
17 |
|
18 |
-
def wine(
|
19 |
print("Calling function")
|
20 |
-
df = pd.DataFrame([[
|
21 |
-
columns=['
|
22 |
print("Predicting")
|
23 |
print(df)
|
24 |
# 'res' is a list of predictions returned as the label.
|
@@ -37,7 +37,7 @@ demo = gr.Interface(
|
|
37 |
description="Experiment with wine features to predict which quality of wine it is.",
|
38 |
allow_flagging="never",
|
39 |
inputs=[
|
40 |
-
gr.Number(value=0, label="
|
41 |
gr.Number(value=7.0, label="fixed_acidity"),
|
42 |
gr.Number(value=0.0, label="volatile_acidity"),
|
43 |
gr.Number(value=0.0, label="citric_acid"),
|
|
|
15 |
model = joblib.load(model_dir + "/wine_model.pkl")
|
16 |
print("Model downloaded")
|
17 |
|
18 |
+
def wine(type,fixed_acidity,volatile_acidity,citric_acid,residual_sugar,chlorides,free_sulfur_dioxide,total_sulfur_dioxide,density,ph,sulphates,alcohol,quality):
|
19 |
print("Calling function")
|
20 |
+
df = pd.DataFrame([[type,fixed_acidity,volatile_acidity,citric_acid,residual_sugar,chlorides,free_sulfur_dioxide,total_sulfur_dioxide,density,ph,sulphates,alcohol,quality]],
|
21 |
+
columns=['type','fixed_acidity','volatile_acidity','citric_acid','residual_sugar','chlorides','free_sulfur_dioxide','total_sulfur_dioxide','density','ph','sulphates','alcohol','quality'])
|
22 |
print("Predicting")
|
23 |
print(df)
|
24 |
# 'res' is a list of predictions returned as the label.
|
|
|
37 |
description="Experiment with wine features to predict which quality of wine it is.",
|
38 |
allow_flagging="never",
|
39 |
inputs=[
|
40 |
+
gr.Number(value=0, label="type 0 for white, 1 for red"),
|
41 |
gr.Number(value=7.0, label="fixed_acidity"),
|
42 |
gr.Number(value=0.0, label="volatile_acidity"),
|
43 |
gr.Number(value=0.0, label="citric_acid"),
|