Enric Perpinyà Pitarch commited on
Commit
a715e4b
1 Parent(s): 9db15a2
Files changed (2) hide show
  1. app.py +7 -14
  2. requirements.txt +1 -1
app.py CHANGED
@@ -10,7 +10,7 @@ project = hw.login(project="jayeshv")
10
  fs = project.get_feature_store()
11
 
12
  mr = project.get_model_registry()
13
- model = mr.get_model("wine_model", version=1)
14
  model_dir = model.download()
15
 
16
  model = joblib.load(model_dir+'/wine_model.pkl')
@@ -41,12 +41,11 @@ def wine(type,
41
  'ph', 'sulphates', 'alcohol'])
42
 
43
  print("Predicting...")
44
- print(df)
45
 
46
  res = model.predict(df)
47
  print(res)
48
 
49
- return int(res.round()) + 3
50
 
51
  demo = gr.Interface(
52
  fn = wine,
@@ -55,17 +54,11 @@ demo = gr.Interface(
55
  allow_flagging = 'never',
56
  inputs = [
57
  gr.Number(value=0, label="type"),
58
- gr.Number(value=0.67, label="fixed_acidity"),
59
- gr.Number(value=-0.38, label="volatile_acidity"),
60
- gr.Number(value=0.55, label="citric_acid"),
61
- gr.Number(value=0.4, label="residual_sugar"),
62
- gr.Number(value=-0.18, label="chlorides"),
63
- gr.Number(value=-0.0033, label="free_sulfur_dioxide"),
64
- gr.Number(value=-0.3, label="total_sulfur_dioxide"),
65
- gr.Number(value=0.19, label="density"),
66
- gr.Number(value=0.22, label="ph"),
67
- gr.Number(value=-0.62, label="sulphates"),
68
- gr.Number(value=-0.37, label="alcohol")
69
  ],
70
  outputs="number" # output's an integer from 3-9
71
  )
 
10
  fs = project.get_feature_store()
11
 
12
  mr = project.get_model_registry()
13
+ model = mr.get_model("wine_model", version=2)
14
  model_dir = model.download()
15
 
16
  model = joblib.load(model_dir+'/wine_model.pkl')
 
41
  'ph', 'sulphates', 'alcohol'])
42
 
43
  print("Predicting...")
 
44
 
45
  res = model.predict(df)
46
  print(res)
47
 
48
+ return res
49
 
50
  demo = gr.Interface(
51
  fn = wine,
 
54
  allow_flagging = 'never',
55
  inputs = [
56
  gr.Number(value=0, label="type"),
57
+ gr.Number(value=6.3, label="fixed_acidity"),
58
+ gr.Number(value=0.30, label="volatile_acidity"),
59
+ gr.Number(value=0.49, label="sulphates"),
60
+ gr.Number(value=9.5, label="alcohol"),
61
+ gr.Number(value=0.994, label="density")
 
 
 
 
 
 
62
  ],
63
  outputs="number" # output's an integer from 3-9
64
  )
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
  hopsworks
2
  joblib
3
- scikit-learn==1.1.1
4
  xgboost
 
1
  hopsworks
2
  joblib
3
+ scikit-learn
4
  xgboost