Spaces:
Runtime error
Runtime error
# app.py | |
from flask import Flask, request, jsonify | |
import joblib | |
app = Flask(__name__) | |
# Load trained model | |
model = joblib.load('model.pkl') | |
def predict(): | |
# Get input data | |
data = request.json['data'] | |
# Make predictions | |
predictions = model.predict(data) | |
# Return predictions | |
return jsonify({'predictions': predictions.tolist()}) | |
if __name__ == '__main__': | |
app.run(debug=True) | |