data2aihub commited on
Commit
d62dc8c
·
verified ·
1 Parent(s): 253c7a2

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -33,16 +33,16 @@ def predict_rental_price():
33
 
34
  # Extract relevant features from the JSON data
35
  sample = {
36
- 'Product_Weight': property_data['Product_Weight'],
37
- 'Product_Sugar_Content': property_data['Product_Sugar_Content'],
38
- 'Product_Allocated_Area': property_data['Product_Allocated_Area'],
39
- 'Product_Type': property_data['Product_Type'],
40
- 'Product_MRP': property_data['Product_MRP'],
41
- 'Store_Id': property_data['Store_Id'],
42
- 'Store_Age': property_data['Store_Age'],
43
- 'Store_Size': property_data['Store_Size'],
44
- 'Store_Location_City_Type': property_data['Store_Location_City_Type'],
45
- 'Store_Type': property_data['Store_Type']
46
  }
47
 
48
  # Convert the extracted data into a Pandas DataFrame
@@ -55,7 +55,7 @@ def predict_rental_price():
55
  predicted_price = round(float(predicted_price), 2)
56
  return jsonify({'Predicted Revenue (in dollars)': predicted_price})
57
 
58
- '''
59
  # Define an endpoint for batch prediction (POST request)
60
  @rental_price_predictor_api.post('/v1/rentalbatch')
61
  def predict_rental_price_batch():
@@ -88,7 +88,7 @@ def predict_rental_price_batch():
88
 
89
  # Return the predictions dictionary as a JSON response
90
  return jsonify(output_dict)
91
- '''
92
  # Run the Flask application in debug mode if this script is executed directly
93
  if __name__ == '__main__':
94
  rental_price_predictor_api.run(debug=True)
 
33
 
34
  # Extract relevant features from the JSON data
35
  sample = {
36
+ 'Product_Weight': property_data['product_weight'],
37
+ 'Product_Sugar_Content': property_data['product_sugar_content'],
38
+ 'Product_Allocated_Area': property_data['product_allocated_area'],
39
+ 'Product_Type': property_data['product_type'],
40
+ 'Product_MRP': property_data['product_mrp'],
41
+ 'Store_Id': property_data['store_id'],
42
+ 'Store_Age': property_data['store_age'],
43
+ 'Store_Size': property_data['store_size'],
44
+ 'Store_Location_City_Type': property_data['store_location_city_type'],
45
+ 'Store_Type': property_data['store_type']
46
  }
47
 
48
  # Convert the extracted data into a Pandas DataFrame
 
55
  predicted_price = round(float(predicted_price), 2)
56
  return jsonify({'Predicted Revenue (in dollars)': predicted_price})
57
 
58
+
59
  # Define an endpoint for batch prediction (POST request)
60
  @rental_price_predictor_api.post('/v1/rentalbatch')
61
  def predict_rental_price_batch():
 
88
 
89
  # Return the predictions dictionary as a JSON response
90
  return jsonify(output_dict)
91
+
92
  # Run the Flask application in debug mode if this script is executed directly
93
  if __name__ == '__main__':
94
  rental_price_predictor_api.run(debug=True)