From e9d1153a356d79d9c41856d84d9b14aa06f42b36 Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Wed, 11 May 2022 20:47:50 +0200 Subject: [PATCH] Revert file parameter --- Jenkinsfile-predict-s444356 | 5 ----- predict_s444356.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Jenkinsfile-predict-s444356 b/Jenkinsfile-predict-s444356 index d131e75..5a9f0f9 100644 --- a/Jenkinsfile-predict-s444356 +++ b/Jenkinsfile-predict-s444356 @@ -5,10 +5,6 @@ pipeline { } } parameters { - file( - name: 'input_example.json', - description: 'Example input file for the model' - ) buildSelector( defaultSelector: lastSuccessful(), description: 'Which build to use for copying artifacts', @@ -24,7 +20,6 @@ pipeline { } stage('Predict values using model from artifact') { steps { - sh "cat input_example.json" sh "python predict_s444356.py" } } diff --git a/predict_s444356.py b/predict_s444356.py index 89fb5a1..247c1e3 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('input_example.json') as f: +with open(f'{logged_model}/input_example.json') as f: data = json.load(f) input_example = np.array([data['inputs'][0]], dtype=np.float64).reshape(-1, 2)