From 2a66ea7685aaf6d00194188370806baed272e706 Mon Sep 17 00:00:00 2001 From: Rethakgetse-Manaka Date: Wed, 25 Sep 2024 21:18:13 +0200 Subject: [PATCH 1/2] Trying to fix connection --- python-code/prediction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-code/prediction.py b/python-code/prediction.py index 58f2340b..ad0ab6e8 100644 --- a/python-code/prediction.py +++ b/python-code/prediction.py @@ -4,7 +4,7 @@ from sklearn.preprocessing import StandardScaler import logging -# Define the URL for the TensorFlow Serving API for both daily and hourly model +# Define the URL for the TensorFlow Serving API for both daily and hourly models daily_model_url = 'http://model:8501/v1/models/attendance_model:predict' hourly_model_url = 'http://hourly-model:8501/v1/models/hourly_attendance_model:predict' # Adjust the URL as needed From 55812ed99751f4eb8c24e7911ae09f1e844508cc Mon Sep 17 00:00:00 2001 From: Rethakgetse-Manaka Date: Wed, 25 Sep 2024 21:23:53 +0200 Subject: [PATCH 2/2] Adjusting cors --- python-code/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-code/app.py b/python-code/app.py index 8e773446..de932d06 100644 --- a/python-code/app.py +++ b/python-code/app.py @@ -9,7 +9,7 @@ # Initialize the Flask application app = Flask(__name__) -CORS(app, resources={r"/*": {"origins": ["*"]}}) +CORS(app, resources={r"/*": {"origins": ["https://dev.occupi.tech, https://occupi.tech"]}}) # Load the scaler scaler = joblib.load('attendance_scaler.pkl')