File size: 415 Bytes
947b25c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# app.py
from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route('/')
def home():
    return "Welcome to the Python API!"

@app.route('/predict', methods=['POST'])
def predict():
    data = request.json
    # Here you would include your model prediction logic
    return jsonify({"prediction": "some result"})

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8000)