diff --git a/.circleci/config.yml b/.circleci/config.yml index db25d0339..0b91c1b3f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,7 +54,7 @@ jobs: - run: name: Deploy to Railway App (You must set RAILWAY_TOKEN env var) command: | - cd section-07-ci-and-publishing/house-prices-api && railway up --detach + cd section-07-ci-and-publishing/house-prices-api && railway up --detach -s splendid-writer -e production section_07_test_and_upload_regression_model: <<: *defaults @@ -92,7 +92,7 @@ jobs: - run: name: Build and run Dockerfile (see https://docs.railway.app/deploy/dockerfiles) command: | - cd section-08-deploying-with-containers && railway up --detach + cd section-08-deploying-with-containers && railway up --detach -s splendid-writer -e production test_regression_model_py37: docker: @@ -279,7 +279,15 @@ workflows: - demo # upload after git tags are created - section_07_test_and_upload_regression_model: - <<: *tags_only + # <<: *tags_only + requires: + - section_07_deploy_app_to_railway + filters: + branches: + only: + - main + - master + - demo - section_08_deploy_app_container_via_railway: filters: diff --git a/section-07-ci-and-publishing/model-package/regression_model/VERSION b/section-07-ci-and-publishing/model-package/regression_model/VERSION index c4e41f945..4d54daddb 100644 --- a/section-07-ci-and-publishing/model-package/regression_model/VERSION +++ b/section-07-ci-and-publishing/model-package/regression_model/VERSION @@ -1 +1 @@ -4.0.3 +4.0.2 diff --git a/section-07-ci-and-publishing/model-package/regression_model/predict.py b/section-07-ci-and-publishing/model-package/regression_model/predict.py index d27739780..7a9bc55c5 100644 --- a/section-07-ci-and-publishing/model-package/regression_model/predict.py +++ b/section-07-ci-and-publishing/model-package/regression_model/predict.py @@ -25,9 +25,10 @@ def make_prediction( if not errors: predictions = _price_pipe.predict( X=validated_data[config.model_config.features] - ) + ) + dtype = np.result_type(np.float32, predictions) results = { - "predictions": [np.exp(pred) for pred in predictions], # type: ignore + "predictions": [np.exp(pred).astype(dtype) for pred in predictions], # type: ignore "version": _version, "errors": errors, } diff --git a/section-07-ci-and-publishing/model-package/tox.ini b/section-07-ci-and-publishing/model-package/tox.ini index d93e00636..8ae84679e 100644 --- a/section-07-ci-and-publishing/model-package/tox.ini +++ b/section-07-ci-and-publishing/model-package/tox.ini @@ -21,6 +21,7 @@ passenv = KAGGLE_USERNAME KAGGLE_KEY GEMFURY_PUSH_URL + RAILWAY_TOKEN [testenv:test_package] allowlist_externals = python