Spaces:
Running
Running
from flask import Blueprint, request, jsonify | |
from .model import predict | |
api = Blueprint('api', __name__) | |
def predict_route(): | |
data = request.get_json() | |
if not data or 'input' not in data: | |
return jsonify({'error': 'Invalid input'}), 400 | |
prediction = predict(data['input']) | |
return jsonify({'prediction': prediction}) | |