| from flask import Flask, request, jsonify | |
| app = Flask(__name__) | |
| 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) | |