InstantID / app.py
yamildiego's picture
fake bufalo
0ebb335
raw
history blame
457 Bytes
from flask import Flask, request, jsonify
from handler import EndpointHandler
app = Flask(__name__)
model_handler = EndpointHandler("./")
@app.route("/predict", methods=["POST"])
def predict():
input_data = request.json
text = input_data["text"]
# Usar el handler para hacer una predicción
prediction = model_handler.call(text)
return jsonify({"prediction": prediction})
if __name__ == "__main__":
app.run(debug=True)