jonathanarns commited on
Commit
4ea649b
·
1 Parent(s): 5b98c1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -17,16 +17,11 @@ print("Model downloaded")
17
 
18
  def wine(alcohol, volatile_acidity, total_sulfur_dioxide, chlorides, density):
19
  print("Calling function")
20
- # df = pd.DataFrame([[sepal_length],[sepal_width],[petal_length],[petal_width]],
21
  df = pd.DataFrame([[alcohol, volatile_acidity, total_sulfur_dioxide, chlorides, density]],
22
- columns=["alcohol", "volatile acidity", "total sulfur dioxide", "chlorides", "density"])
23
  print("Predicting")
24
  print(df)
25
- # 'res' is a list of predictions returned as the label.
26
  res = model.predict(df)
27
- # We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
28
- # the first element.
29
- # print("Res: {0}").format(res)
30
  print(res)
31
  return res[0]
32
 
@@ -44,5 +39,5 @@ demo = gr.Interface(
44
  ],
45
  outputs=gr.Number(label="Prediction"))
46
 
47
- demo.launch(debug=True)
48
 
 
17
 
18
  def wine(alcohol, volatile_acidity, total_sulfur_dioxide, chlorides, density):
19
  print("Calling function")
 
20
  df = pd.DataFrame([[alcohol, volatile_acidity, total_sulfur_dioxide, chlorides, density]],
21
+ columns=["alcohol", "volatile_acidity", "total_sulfur_dioxide", "chlorides", "density"])
22
  print("Predicting")
23
  print(df)
 
24
  res = model.predict(df)
 
 
 
25
  print(res)
26
  return res[0]
27
 
 
39
  ],
40
  outputs=gr.Number(label="Prediction"))
41
 
42
+ demo.launch(debug=True, share=True)
43