Mahmoud7 commited on
Commit
c3c364d
·
1 Parent(s): fb93438

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -1,7 +1,11 @@
1
  import streamlit as st
2
  import pandas as pd
3
- import requests
4
- import json
 
 
 
 
5
 
6
  st.write(""" # Mobile Price-Range Prediction""")
7
  st.sidebar.header("Choose Phone Specs")
@@ -24,5 +28,6 @@ st.subheader("Phone Specs")
24
  st.write(feats)
25
 
26
  if st.button("Result"):
27
- res = requests.post(url = "http://0.0.0.0:8008/predict", data=json.dumps(data)).text
 
28
  st.subheader(f"Predicted Price Range: {res}")
 
1
  import streamlit as st
2
  import pandas as pd
3
+ #import requests
4
+ #import json
5
+ import pickle
6
+
7
+ with open(r"C:\Users\lenovo\PycharmProjects\MLOPS\Backend\model.pkl", "rb") as f:
8
+ model = pickle.load(f)
9
 
10
  st.write(""" # Mobile Price-Range Prediction""")
11
  st.sidebar.header("Choose Phone Specs")
 
28
  st.write(feats)
29
 
30
  if st.button("Result"):
31
+ #res = requests.post(url = "http://0.0.0.0:8008/predict", data=json.dumps(data)).text
32
+ res = model.predict(feats)
33
  st.subheader(f"Predicted Price Range: {res}")