diff --git a/.github/workflows/action_demo.yml b/.github/workflows/action_demo.yml index e0fb44b..eb80f41 100644 --- a/.github/workflows/action_demo.yml +++ b/.github/workflows/action_demo.yml @@ -24,8 +24,8 @@ jobs: run: python3 digits.py --runs 4 --test_sizes 0.3 --dev_sizes 0.2 --prod tree --candidate svm - name: Run test cases run: python3 -m pytest - - name: Run docker commands - run: source ./docker/docker_run.sh + # - name: Run docker commands + # run: source ./docker/docker_run.sh diff --git a/api/app.py b/api/app.py index ed93fac..8fd1193 100644 --- a/api/app.py +++ b/api/app.py @@ -1,4 +1,5 @@ from flask import Flask, request, jsonify +from joblib import load app = Flask(__name__) @@ -9,6 +10,13 @@ def index(name): @app.route('/model', methods=['POST']) def pred_model(): js = request.get_json() - x= js['x'] - y = js['y'] - return x+y \ No newline at end of file + image1 = js['image1'] + image2 = js['image2'] + #Assuming this is the path of our best trained model + model = load('/Users/pranjal/Desktop/ml-ops/models/svmgamma:0.001_C:1.joblib') + prediction_image_1 = model.predict(image1) + prediction_image_2 = model.predict(image2) + if(prediction_image_1 == prediction_image_2): + return "True" + else: + return "False" \ No newline at end of file