erikjacobs commited on
Commit
7ca7464
·
verified ·
1 Parent(s): 7970c3a

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -6,7 +6,8 @@ from flask import Flask, request, jsonify
6
  churn_predictor_api = Flask("Customer Churn Predictor")
7
 
8
  # Load the trained churn prediction model
9
- model = joblib.load("/content/drive/MyDrive/Great Learning - U Texas/29 Containerization/churn_prediction_model_v1_0.joblib")
 
10
 
11
  # Define a route for the home page
12
  @churn_predictor_api.get('/')
@@ -48,7 +49,8 @@ def predict_churn():
48
  @churn_predictor_api.post('/v1/customerbatch')
49
  def predict_churn_batch():
50
  # Get the uploaded CSV file from the request
51
- file = request.files['/content/drive/MyDrive/Great Learning - U Texas/29 Containerization/bank_customer_churn.csv']
 
52
 
53
  # Read the file into a DataFrame
54
  input_data = pd.read_csv(file)
 
6
  churn_predictor_api = Flask("Customer Churn Predictor")
7
 
8
  # Load the trained churn prediction model
9
+ # Correct the path to load the model from the /app directory in the container
10
+ model = joblib.load("/app/churn_prediction_model_v1_0.joblib")
11
 
12
  # Define a route for the home page
13
  @churn_predictor_api.get('/')
 
49
  @churn_predictor_api.post('/v1/customerbatch')
50
  def predict_churn_batch():
51
  # Get the uploaded CSV file from the request
52
+ # Correct the path to read the file directly from the request
53
+ file = request.files['file']
54
 
55
  # Read the file into a DataFrame
56
  input_data = pd.read_csv(file)