BuckLakeAI / app /routes.py
parkerjj's picture
First Commit for test Hugging face platform
547b48b
raw
history blame
383 Bytes
from flask import Blueprint, request, jsonify
from .model import predict
api = Blueprint('api', __name__)
@api.route('/predict', methods=['POST'])
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})