ayush-vatsal commited on
Commit
413f33f
·
1 Parent(s): edbcc20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -13,15 +13,13 @@ st.set_page_config(
13
  layout='wide'
14
  )
15
 
16
- def model():
17
- project = hopsworks.login()
18
- fs = project.get_feature_store()
19
-
20
  mr = project.get_model_registry()
21
- model = mr.get_model("car_prices", version=1)
22
  model_dir = model.download()
23
- mode = joblib.load(model_dir + "/car_prices_model.pkl")
24
- return mode
25
  header = st.container()
26
 
27
  model_train = st.container()
@@ -95,6 +93,7 @@ if (input_list[13] == "Manual"):
95
  input_list.insert(14, 1)
96
 
97
  df = pd.DataFrame(input_list)
 
98
  res = model.predict(df.T)[0].round(4)
99
 
100
  with model_train:
 
13
  layout='wide'
14
  )
15
 
16
+ @st.cache(allow_output_mutation=True,suppress_st_warning=True)
17
+ def get_model(project = project):
 
 
18
  mr = project.get_model_registry()
19
+ model = mr.get_model("cc_fraud", version = 1)
20
  model_dir = model.download()
21
+ return joblib.load(model_dir + "/cc_fraud_model.pkl")
22
+
23
  header = st.container()
24
 
25
  model_train = st.container()
 
93
  input_list.insert(14, 1)
94
 
95
  df = pd.DataFrame(input_list)
96
+ model = get_model(project)
97
  res = model.predict(df.T)[0].round(4)
98
 
99
  with model_train: