Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -43,14 +43,12 @@ def predict_product_sales_price():
|
|
| 43 |
# Define an endpoint to predict product sales price for a batch of product
|
| 44 |
@super_kart_api.post('/v1/productbatch')
|
| 45 |
def predict_product_batch():
|
| 46 |
-
|
| 47 |
file = request.files['file']
|
| 48 |
|
| 49 |
# Read the file into a DataFrame
|
| 50 |
input_data = pd.read_csv(file)
|
| 51 |
|
| 52 |
-
input_data = input_data.drop(['Product_Id','Store_Establishment_Year','Product_Allocated_Area'],axis=1)
|
| 53 |
-
|
| 54 |
# Make predictions for the batch data
|
| 55 |
predictions = model.predict(input_data).tolist()
|
| 56 |
|
|
|
|
| 43 |
# Define an endpoint to predict product sales price for a batch of product
|
| 44 |
@super_kart_api.post('/v1/productbatch')
|
| 45 |
def predict_product_batch():
|
| 46 |
+
# Get the uploaded CSV file from the request
|
| 47 |
file = request.files['file']
|
| 48 |
|
| 49 |
# Read the file into a DataFrame
|
| 50 |
input_data = pd.read_csv(file)
|
| 51 |
|
|
|
|
|
|
|
| 52 |
# Make predictions for the batch data
|
| 53 |
predictions = model.predict(input_data).tolist()
|
| 54 |
|