Textwizai / server.py
Erfan11's picture
Create server.py
fff5045 verified
raw
history blame
No virus
390 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')
# Add model prediction logic here
return jsonify({'prediction': 'example result'})
if __name__ == "__main__":
app.run(debug=True)