Spaces:
Sleeping
Sleeping
Hemang Vyas
commited on
Commit
•
c5a4863
1
Parent(s):
08fc08b
minor fixes
Browse files
app.py
CHANGED
@@ -23,9 +23,6 @@ def predict():
|
|
23 |
return render_template('index.html', prediction_text='Salary is {}'.format(output))
|
24 |
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
@app.route('/predict_api',methods=['POST'])
|
30 |
def predict_api():
|
31 |
'''
|
|
|
23 |
return render_template('index.html', prediction_text='Salary is {}'.format(output))
|
24 |
|
25 |
|
|
|
|
|
|
|
26 |
@app.route('/predict_api',methods=['POST'])
|
27 |
def predict_api():
|
28 |
'''
|
model.pkl
DELETED
Binary file (515 Bytes)
|
|
server.py
CHANGED
@@ -15,7 +15,7 @@ app = Flask(__name__)
|
|
15 |
# Load the model
|
16 |
model = pickle.load(open('model.pkl','rb'))
|
17 |
|
18 |
-
@app.route('/api',methods=['POST'])
|
19 |
def predict():
|
20 |
# Get the data from the POST request.
|
21 |
data = request.get_json(force=True)
|
@@ -29,7 +29,7 @@ def predict():
|
|
29 |
return jsonify(output)
|
30 |
|
31 |
if __name__ == '__main__':
|
32 |
-
|
33 |
-
|
34 |
except:
|
35 |
-
|
|
|
15 |
# Load the model
|
16 |
model = pickle.load(open('model.pkl','rb'))
|
17 |
|
18 |
+
@app.route('/api/',methods=['POST'])
|
19 |
def predict():
|
20 |
# Get the data from the POST request.
|
21 |
data = request.get_json(force=True)
|
|
|
29 |
return jsonify(output)
|
30 |
|
31 |
if __name__ == '__main__':
|
32 |
+
try:
|
33 |
+
app.run(port=5000, debug=True)
|
34 |
except:
|
35 |
+
print("Server is exited unexpectedly. Please contact server admin.")
|