jarpan03 commited on
Commit
92cc03b
·
verified ·
1 Parent(s): b571bc7

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -23,9 +23,11 @@ def predict_product_sales_price():
23
  sample = {
24
  'Product_Weight': product_data['Product_Weight'],
25
  'Product_Sugar_Content': product_data['Product_Sugar_Content'],
 
26
  'Product_Type': product_data['Product_Type'],
27
  'Product_MRP': product_data['Product_MRP'],
28
  'Store_Id': product_data['Store_Id'],
 
29
  'Store_Size': product_data['Store_Size'],
30
  'Store_Location_City_Type': product_data['Store_Location_City_Type'],
31
  'Store_Type': product_data['Store_Type']
@@ -43,12 +45,11 @@ 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
- # 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
- input_data = input_data.drop(['Product_Id','Store_Establishment_Year','Product_Allocated_Area'],axis=1)
52
 
53
  # Make predictions for the batch data
54
  predictions = model.predict(input_data).tolist()
 
23
  sample = {
24
  'Product_Weight': product_data['Product_Weight'],
25
  'Product_Sugar_Content': product_data['Product_Sugar_Content'],
26
+ 'Product_Allocated_Area': product_data['Product_Allocated_Area'],
27
  'Product_Type': product_data['Product_Type'],
28
  'Product_MRP': product_data['Product_MRP'],
29
  'Store_Id': product_data['Store_Id'],
30
+ 'Store_Establishment_Year': product_data['Store_Establishment_Year'],
31
  'Store_Size': product_data['Store_Size'],
32
  'Store_Location_City_Type': product_data['Store_Location_City_Type'],
33
  'Store_Type': product_data['Store_Type']
 
45
  # Define an endpoint to predict product sales price for a batch of product
46
  @super_kart_api.post('/v1/productbatch')
47
  def predict_product_batch():
48
+ # Get the uploaded CSV file from the request
49
  file = request.files['file']
50
 
51
  # Read the file into a DataFrame
52
  input_data = pd.read_csv(file)
 
53
 
54
  # Make predictions for the batch data
55
  predictions = model.predict(input_data).tolist()