Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/action_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand Down
14 changes: 11 additions & 3 deletions api/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from flask import Flask, request, jsonify
from joblib import load

app = Flask(__name__)

Expand All @@ -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
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"