From 8874950fa61cb5c6b582ec1fd7ab0759c1952d39 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Wed, 11 May 2022 20:19:44 +0200 Subject: [PATCH] Use file parameter --- Jenkinsfile-predict-s444356 | 3 +++ predict_s444356.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile-predict-s444356 b/Jenkinsfile-predict-s444356 index f97dc69..bfacc45 100644 --- a/Jenkinsfile-predict-s444356 +++ b/Jenkinsfile-predict-s444356 @@ -4,6 +4,9 @@ pipeline { image 's444409-create-dataset' } } + parameters { + file 'input_example.json' + } stages { stage('Get dataset from artifact') { diff --git a/predict_s444356.py b/predict_s444356.py index 247c1e3..89fb5a1 100644 --- a/predict_s444356.py +++ b/predict_s444356.py @@ -6,7 +6,7 @@ logged_model = 'mlruns/1/296d6f314bb2451885fb7ae58988301e/artifacts/model' loaded_model = mlflow.pyfunc.load_model(logged_model) -with open(f'{logged_model}/input_example.json') as f: +with open('input_example.json') as f: data = json.load(f) input_example = np.array([data['inputs'][0]], dtype=np.float64).reshape(-1, 2)