Spaces:
Runtime error
Runtime error
Commit
·
362aabc
1
Parent(s):
1722e3c
Update app.py
Browse files
app.py
CHANGED
@@ -20,14 +20,14 @@ model_dir_white = model_white.download()
|
|
20 |
model_white = joblib.load(model_dir_white + "/wine_white_model.pkl")
|
21 |
print("White Model downloaded")
|
22 |
|
23 |
-
def wine(
|
24 |
print("Calling function")
|
25 |
df = pd.DataFrame([[alcohol, chlorides, density, volatil_acidity,fixed_acidity, citric_acid,total_sulfur_dioxide]],
|
26 |
columns=['alcohol','chlorides','density','volatil_acidity','fixed_acidity','citric_acid','total_sulfur_dioxide'])
|
27 |
print("Predicting")
|
28 |
print(df)
|
29 |
|
30 |
-
if
|
31 |
res = model_red.predict(df)
|
32 |
print(res)
|
33 |
wine_url = "https://raw.githubusercontent.com/Anniyuku/wine_quality/main/" + res[0] + ".png"
|
@@ -45,7 +45,7 @@ demo = gr.Interface(
|
|
45 |
description="Experiment with type, alcohol, chlorides, density, volatil_acidity, fixed_acidity, citric_acid, total_sulfur_dioxide to predict which flower it is.",
|
46 |
allow_flagging="never",
|
47 |
inputs=[
|
48 |
-
gr.inputs.Radio(choices=[
|
49 |
gr.inputs.Number(default=9.00, label="alcohol"),
|
50 |
gr.inputs.Number(default=0.60, label="chlorides"),
|
51 |
gr.inputs.Number(default=1.00, label="density"),
|
|
|
20 |
model_white = joblib.load(model_dir_white + "/wine_white_model.pkl")
|
21 |
print("White Model downloaded")
|
22 |
|
23 |
+
def wine(category, alcohol, chlorides, density, volatil_acidity,fixed_acidity, citric_acid,total_sulfur_dioxide):
|
24 |
print("Calling function")
|
25 |
df = pd.DataFrame([[alcohol, chlorides, density, volatil_acidity,fixed_acidity, citric_acid,total_sulfur_dioxide]],
|
26 |
columns=['alcohol','chlorides','density','volatil_acidity','fixed_acidity','citric_acid','total_sulfur_dioxide'])
|
27 |
print("Predicting")
|
28 |
print(df)
|
29 |
|
30 |
+
if category == "red":
|
31 |
res = model_red.predict(df)
|
32 |
print(res)
|
33 |
wine_url = "https://raw.githubusercontent.com/Anniyuku/wine_quality/main/" + res[0] + ".png"
|
|
|
45 |
description="Experiment with type, alcohol, chlorides, density, volatil_acidity, fixed_acidity, citric_acid, total_sulfur_dioxide to predict which flower it is.",
|
46 |
allow_flagging="never",
|
47 |
inputs=[
|
48 |
+
gr.inputs.Radio(choices=["white","red"], label='category'),
|
49 |
gr.inputs.Number(default=9.00, label="alcohol"),
|
50 |
gr.inputs.Number(default=0.60, label="chlorides"),
|
51 |
gr.inputs.Number(default=1.00, label="density"),
|