Skip to content

Instantly share code, notes, and snippets.

@ywolff
Created January 6, 2020 11:29
Show Gist options
  • Save ywolff/dc6afbea5871e9b3d90d90e4a2763e17 to your computer and use it in GitHub Desktop.
Save ywolff/dc6afbea5871e9b3d90d90e4a2763e17 to your computer and use it in GitHub Desktop.
import numpy as np
from flask import Flask, request
from build_big_model import build_big_model
model = build_big_model()
app = Flask(__name__)
@app.route('/predict', methods=['POST'])
def predict():
received_input = np.array(request.json['input'])
model_output = model.predict(received_input)
return {'predictions': model_output.tolist()}
if __name__ == '__main__':
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment