File size: 497 Bytes
4760496 f47bb95 4760496 737adfe 825f176 4760496 f47bb95 4760496 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/predict', methods=['POST'])
def predict():
# Get JSON input from the request
# data = request.get_json()
# text = data.get("text", "")
text = request.data
# Perform some dummy prediction (replace with model logic)
prediction = f"Processed text: {text}"
# Return the result
return jsonify({"prediction": prediction})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=7860)
|