Update app.py
Browse files32 unmodified lines33343536373841 unmodified lines808182838432 unmodified linesapp = Flask(__name__)class PredictAPI(MethodView):def post(self):logger.info("Received POST request to /predict")41 unmodified lines# Optional: Keep for local debugging, but not used in Hugging Faceif __name__ == '__main__':logger.info("Starting Flask application for local debugging")port = int(os.getenv('PORT', 5000)) # Use PORT env var if setapp.run(host='0.0.0.0', port=port, debug=True)32 unmodified lines33343536373839404142434441 unmodified lines868788899032 unmodified linesapp = Flask(__name__)# Add a health check endpoint@app.route('/health', methods=['GET'])def health_check():logger.debug("Health check requested")return jsonify({"status": "ok"}), 200class PredictAPI(MethodView):def post(self):logger.info("Received POST request to /predict")41 unmodified lines# Optional: Keep for local debugging, but not used in Hugging Faceif __name__ == '__main__':logger.info("Starting Flask application for local debugging")port = int(os.getenv('PORT', 7860)) # Default to 7860 for consistencyapp.run(host='0.0.0.0', port=port, debug=True)
app.py+7-1