Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -2,8 +2,10 @@
|
|
| 2 |
import numpy as np
|
| 3 |
import joblib # For loading the serialized model
|
| 4 |
import pandas as pd # For data manipulation
|
|
|
|
| 5 |
from flask import Flask, request, jsonify # For creating the Flask API
|
| 6 |
|
|
|
|
| 7 |
# Initialize the Flask application
|
| 8 |
product_sales_predictor_api = Flask("SuperKart Product Sales Predictor")
|
| 9 |
|
|
@@ -66,7 +68,11 @@ def predict_sales_batch():
|
|
| 66 |
and returns the predicted product sales prices as a dictionary in the JSON response.
|
| 67 |
"""
|
| 68 |
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
# Get the uploaded CSV file from the request
|
| 71 |
file = request.files['file']
|
| 72 |
|
|
|
|
| 2 |
import numpy as np
|
| 3 |
import joblib # For loading the serialized model
|
| 4 |
import pandas as pd # For data manipulation
|
| 5 |
+
import logging #DEEPA
|
| 6 |
from flask import Flask, request, jsonify # For creating the Flask API
|
| 7 |
|
| 8 |
+
|
| 9 |
# Initialize the Flask application
|
| 10 |
product_sales_predictor_api = Flask("SuperKart Product Sales Predictor")
|
| 11 |
|
|
|
|
| 68 |
and returns the predicted product sales prices as a dictionary in the JSON response.
|
| 69 |
"""
|
| 70 |
|
| 71 |
+
handler = logging.FileHandler('app.log')
|
| 72 |
+
app.logger.addHandler(handler)
|
| 73 |
+
app.logger.setLevel(logging.INFO)
|
| 74 |
+
app.logger.info('Request received')
|
| 75 |
+
|
| 76 |
# Get the uploaded CSV file from the request
|
| 77 |
file = request.files['file']
|
| 78 |
|