Open MyReason92 opened 4 months ago
from flask import Flask, request, jsonify import time import logging
app = Flask(name) logging.basicConfig(filename='app.log', level=logging.INFO)
@app.route('/predict', methods=['GET']) def predict(): start_time = time.time() country = request.args.get('country') date = request.args.get('date')
end_time = time.time() logging.info(f'Prediction for {country} on {date} took {end_time - start_time} seconds') return jsonify({'prediction': 'some_value'})
from flask import Flask, request, jsonify import time import logging
app = Flask(name) logging.basicConfig(filename='app.log', level=logging.INFO)
@app.route('/predict', methods=['GET']) def predict(): start_time = time.time() country = request.args.get('country') date = request.args.get('date')
Perform prediction logic