diff --git a/config/settings.yaml b/config/settings.yaml index 8c01a2b..490d6c7 100644 --- a/config/settings.yaml +++ b/config/settings.yaml @@ -1,9 +1,9 @@ # MODEL SETTINGS -FEATURES: ['Gender_Male', 'Age_q2', 'Age_q4', 'CAEC_Frequently', 'CAEC_Sometimes', 'CAEC_no', 'SMOKE_yes', 'SCC_yes', 'CALC_infrequent_sklearn', 'MTRANS_Public_Transportation', 'MTRANS_Walking', 'MTRANS_infrequent_sklearn', 'IS_1', 'FCVC', 'FAF', 'TUE', 'BMI', 'BMR'] +FEATURES: ['Gender_x0_Male', 'Age_x0_q2', 'Age_x0_q4', 'CAEC_x0_Frequently', 'CAEC_x0_Sometimes', 'CAEC_x0_no', 'SMOKE_x0_yes', 'SCC_x0_yes', 'CALC_x0_infrequent_sklearn', 'MTRANS_x0_Public_Transportation', 'MTRANS_x0_Walking', 'MTRANS_x0_infrequent_sklearn', 'IS_x0_1', 'FCVC', 'FAF', 'TUE', 'BMI', 'BMR'] MODEL_NAME: 'xgboost' MODEL_FLAVOR: 'xgboost' -RUN_ID: 'ff943ce028b1479795153a8f13106894' -EXPERIMENT_ID: '755921522963084808' +RUN_ID: 'e7d3cea9b93b4dd18ae421c402520a2c' +EXPERIMENT_ID: '708342276728582022' VERSION: '1.0' # GENERAL SETTINGS @@ -11,6 +11,7 @@ DATA_PATH: '/media/greca/HD/GitHub/e2e-mlops-project/data/' RAW_FILE_NAME: 'Original_ObesityDataSet.csv' ARTIFACTS_PATH: '/media/greca/HD/GitHub/e2e-mlops-project/models/artifacts/' FEATURES_PATH: '/media/greca/HD/GitHub/e2e-mlops-project/models/features/' +RESEARCH_ENVIRONMENT_PATH: '/media/greca/HD/GitHub/e2e-mlops-project/notebooks/' TARGET_COLUMN: 'NObeyesdad' LOG_LEVEL: 'INFO' LOG_PATH: '/media/greca/HD/GitHub/e2e-mlops-project/' \ No newline at end of file diff --git a/src/api.py b/src/api.py index c14d0b2..9d80be9 100644 --- a/src/api.py +++ b/src/api.py @@ -1,16 +1,24 @@ import pandas as pd +import mlflow from fastapi import FastAPI from .data.processing import data_processing_inference from .config.model import model_settings +from .config.aws import aws_credentials +from .config.settings import general_settings from .model.inference import ModelServe from .schema.person import Person app = FastAPI() +if aws_credentials.EC2 != "YOUR_EC2_INSTANCE_URL": + mlflow.set_tracking_uri(f"http://{aws_credentials.EC2}:5000") +else: + mlflow.set_tracking_uri(f"http://127.0.0.1:5000") + @app.get("/version") def check_versions(): - with open("../notebooks/VERSION", "r", encoding="utf-8") as f: + with open(f"{general_settings.RESEARCH_ENVIRONMENT_PATH}/VERSION", "r", encoding="utf-8") as f: code_version = f.readline().strip() return { diff --git a/src/config/settings.py b/src/config/settings.py index 9b82b54..900eb81 100644 --- a/src/config/settings.py +++ b/src/config/settings.py @@ -20,6 +20,7 @@ class GeneralSettings(BaseModel): TARGET_COLUMN: str LOG_LEVEL: str LOG_PATH: DirectoryPath + RESEARCH_ENVIRONMENT_PATH: DirectoryPath general_settings = GeneralSettings( **read_yaml_credentials_file(