Arafath10 commited on
Commit
662feb4
1 Parent(s): 5eb4a0e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -7
main.py CHANGED
@@ -27,26 +27,24 @@ app.add_middleware(
27
 
28
  # Endpoint for making predictions
29
  @app.post("/predict")
30
- def predict(customer_name: str,
 
31
  customer_address: str,
32
  customer_phone: str,
33
  customer_email: str,
34
- cod:str,
35
  weight: str,
36
  pickup_address: str,
37
- origin_city_name: str,
38
- destination_city_name: str,
39
- origin_country: str):
40
  # Convert input data to DataFrame
41
  input_data = {
42
  'customer_name': customer_name,
43
  'customer_address': customer_address,
44
  'customer_phone': customer_phone,
45
  'customer_email': customer_email,
46
- 'cod': float(cod),
47
  'weight': float(weight),
48
  'pickup_address':pickup_address,
49
- 'origin_city.name':origin_city_name,
50
  'destination_city.name':destination_city_name
51
  }
52
  input_df = pd.DataFrame([input_data])
 
27
 
28
  # Endpoint for making predictions
29
  @app.post("/predict")
30
+ def predict(
31
+ customer_name: str,
32
  customer_address: str,
33
  customer_phone: str,
34
  customer_email: str,
 
35
  weight: str,
36
  pickup_address: str,
37
+ destination_city_name: str):
 
 
38
  # Convert input data to DataFrame
39
  input_data = {
40
  'customer_name': customer_name,
41
  'customer_address': customer_address,
42
  'customer_phone': customer_phone,
43
  'customer_email': customer_email,
44
+ 'cod': 1.0,
45
  'weight': float(weight),
46
  'pickup_address':pickup_address,
47
+ 'origin_city.name':"origin_city_name",
48
  'destination_city.name':destination_city_name
49
  }
50
  input_df = pd.DataFrame([input_data])