sudhirpgcmma02 commited on
Commit
65a6c50
·
verified ·
1 Parent(s): 8c20de9

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. backend/app.py +4 -0
  2. frontend/Frontend_app.py +5 -2
backend/app.py CHANGED
@@ -15,3 +15,7 @@ def predict():
15
  df = pd.DataFrame([data])
16
  prediction = model.predict(df)
17
  return jsonify({"prediction": prediction.tolist()})
 
 
 
 
 
15
  df = pd.DataFrame([data])
16
  prediction = model.predict(df)
17
  return jsonify({"prediction": prediction.tolist()})
18
+
19
+ # Run the Flask application in debug mode if this script is executed directly
20
+ if __name__ == '__main__':
21
+ app.run(debug=True)
frontend/Frontend_app.py CHANGED
@@ -20,5 +20,8 @@ if st.button("Predict"):
20
  "sale_volume_lag_3": lag3,
21
  "sale_volume_lag_6": lag6
22
  }
23
- res = requests.post("http://172.28.0.12:7860/predict", json=payload)
24
- st.success(f"Prediction: {res.json()['prediction']}")
 
 
 
 
20
  "sale_volume_lag_3": lag3,
21
  "sale_volume_lag_6": lag6
22
  }
23
+ res = requests.post("https://sudhirpgcmma02/Hy_prediction.hf.space/predict", json=payload)
24
+ if res.status_code == 200:
25
+ st.success(f"Prediction: {res.json()['prediction']}")
26
+ else:
27
+ st.error("Error making prediction.")