jarpan03 commited on
Commit
ba254b1
·
verified ·
1 Parent(s): 6ad1123

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app.py +2 -3
  2. super_kart_model_v1_0.joblib +2 -2
app.py CHANGED
@@ -23,11 +23,9 @@ 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_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,11 +43,12 @@ def predict_product_sales_price():
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()
 
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
  # 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()
super_kart_model_v1_0.joblib CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e1101d4e720ab19a7af36a63f3ce911a05a3fc56da59fe34ee106156ab5dd1c
3
- size 653576
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:928b73c125a9a0a11d46cceaee99bbd78754562764ca064764ae121f019276cf
3
+ size 619822