Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
topguns837 authored Jan 8, 2022
1 parent 7fceebe commit b329a57
Show file tree
Hide file tree
Showing 6 changed files with 6,122 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Python/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from flask import Flask,jsonify
#from flask.ext.cors import CORS, cross_origin
import pandas as pd
from sklearn import preprocessing
from sklearn.linear_model import LinearRegression
import csv
import pickle

path="E:/projects/i-spy/Python/model.sav"
model = pickle.load(open(path,'rb'))


app=Flask(__name__)

#current code for API routing
@app.route('/<string:input_str>',methods=['GET'])
def get_input(input_str):
print("loop")
input_str=input_str.replace('_',' ')
ans=model.predict([input_str])
print(ans)
return jsonify({"ans":str(int(ans[0]))})

@app.route('/',methods=['GET'])
def home_page():

return "home"



if __name__== "__main__":
app.run(debug=True)
Loading

0 comments on commit b329a57

Please sign in to comment.