Textwizai / server.py
Erfan11's picture
Update server.py
14406ca verified
raw
history blame
449 Bytes
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/')
def index():
return "Welcome to the AI application!"
@app.route('/predict', methods=['POST'])
def predict():
data = request.json
text = data.get('text')
# Example prediction logic
result = "example result" # Replace with actual model prediction logic
return jsonify({'prediction': result})
if __name__ == "__main__":
app.run(debug=True)