TokenTutor commited on
Commit
7feb426
·
verified ·
1 Parent(s): 0f48ef3

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -17,20 +17,20 @@ def home():
17
  @sales_revenue_predictor_api.post('/v1/product_sales_revenue')
18
  def predict_churn():
19
  # Get JSON data from the request
20
- customer_data = request.get_json()
21
 
22
  # Extract relevant customer features from the input data
23
  sample = {
24
- 'Product_Weight': customer_data['Product_Weight'],
25
- 'Product_Sugar_Content': customer_data['Product_Sugar_Content'],
26
- 'Product_Allocated_Area': customer_data['Product_Allocated_Area'],
27
- 'Product_Type': customer_data['Product_Type'],
28
- 'Product_MRP': customer_data['Product_MRP'],
29
- 'Store_Id': customer_data['Store_Id'],
30
- 'Store_Establishment_Year': customer_data['Store_Establishment_Year'],
31
- 'Store_Size': customer_data['Store_Size'],
32
- 'Store_Location_City_Type': customer_data['Store_Location_City_Type'],
33
- 'Store_Type': customer_data['Store_Type']
34
  }
35
 
36
  # Convert the extracted data into a DataFrame
 
17
  @sales_revenue_predictor_api.post('/v1/product_sales_revenue')
18
  def predict_churn():
19
  # Get JSON data from the request
20
+ product_data = request.get_json()
21
 
22
  # Extract relevant customer features from the input data
23
  sample = {
24
+ 'Product_Weight': product_data.get('Product_Weight'),
25
+ 'Product_Sugar_Content': product_data.get('Product_Sugar_Content'),
26
+ 'Product_Allocated_Area': product_data.get('Product_Allocated_Area'),
27
+ 'Product_Type': product_data.get('Product_Type'),
28
+ 'Product_MRP': product_data.get('Product_MRP'),
29
+ 'Store_Id': product_data.get('Store_Id'),
30
+ 'Store_Establishment_Year': product_data.get('Store_Establishment_Year'),
31
+ 'Store_Size': product_data.get('Store_Size'),
32
+ 'Store_Location_City_Type': product_data.get('Store_Location_City_Type'),
33
+ 'Store_Type': product_data.get('Store_Type')
34
  }
35
 
36
  # Convert the extracted data into a DataFrame