Spaces:
No application file
No application file
Upload folder using huggingface_hub
Browse files- Docker +2 -2
- backend/app.py +1 -1
- frontend/Frontend_app.py +1 -1
Docker
CHANGED
|
@@ -12,8 +12,8 @@ COPY . .
|
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
# Expose ports for Flask (5000) and Streamlit (8501)
|
| 15 |
-
EXPOSE
|
| 16 |
-
EXPOSE
|
| 17 |
|
| 18 |
# Run both Flask and Streamlit together
|
| 19 |
CMD ["bash", "-c", "python model/backend/app.py & streamlit run model/frontend/Frontend_app.py --server.port=7860 --server.address=0.0.0.0"]
|
|
|
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
# Expose ports for Flask (5000) and Streamlit (8501)
|
| 15 |
+
EXPOSE 8501
|
| 16 |
+
EXPOSE 8501
|
| 17 |
|
| 18 |
# Run both Flask and Streamlit together
|
| 19 |
CMD ["bash", "-c", "python model/backend/app.py & streamlit run model/frontend/Frontend_app.py --server.port=7860 --server.address=0.0.0.0"]
|
backend/app.py
CHANGED
|
@@ -7,7 +7,7 @@ import pandas as pd
|
|
| 7 |
app = Flask(__name__)
|
| 8 |
|
| 9 |
# Load model
|
| 10 |
-
model = joblib.load("best_dealer_forecast_model.joblib")
|
| 11 |
|
| 12 |
@app.route("/predict", methods=["POST"])
|
| 13 |
def predict():
|
|
|
|
| 7 |
app = Flask(__name__)
|
| 8 |
|
| 9 |
# Load model
|
| 10 |
+
model = joblib.load("model/best_dealer_forecast_model.joblib")
|
| 11 |
|
| 12 |
@app.route("/predict", methods=["POST"])
|
| 13 |
def predict():
|
frontend/Frontend_app.py
CHANGED
|
@@ -20,5 +20,5 @@ if st.button("Predict"):
|
|
| 20 |
"sale_volume_lag_3": lag3,
|
| 21 |
"sale_volume_lag_6": lag6
|
| 22 |
}
|
| 23 |
-
res = requests.post("http://
|
| 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("http://172.28.0.12:8501/predict", json=payload)
|
| 24 |
st.success(f"Prediction: {res.json()['prediction']}")
|