sga123 commited on
Commit
de01370
·
verified ·
1 Parent(s): e4273e0

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. Dockerfile +0 -1
  2. app.py +1 -6
Dockerfile CHANGED
@@ -21,4 +21,3 @@ EXPOSE 8501
21
 
22
  # Command to run the Streamlit application
23
  CMD ["streamlit", "run", "app.py", "--server.port", "8501", "--server.address", "0.0.0.0"]
24
-
 
21
 
22
  # Command to run the Streamlit application
23
  CMD ["streamlit", "run", "app.py", "--server.port", "8501", "--server.address", "0.0.0.0"]
 
app.py CHANGED
@@ -8,21 +8,16 @@ model = joblib.load("D:/Machine_Learning_Neural_Nets_Course/SuperKart/backend_fi
8
  # @sapp.get('/')
9
  # def home():
10
  # return "Welcome to the Supermarket Product Price Predictor!"
11
-
12
-
13
  # Define an endpoint
14
  ##@app.post('/v1/price')
15
- @sapp.get('/')
16
  def predict_price():
17
  # Get JSON data from the request
18
  input_json = request.get_json()
19
-
20
  # Convert the extracted data into a DataFrame
21
  input_data = pd.DataFrame([input_json])
22
-
23
  # Make a churn prediction using the trained model
24
  prediction = model.predict(input_data)
25
-
26
  # Return the prediction as a JSON response
27
  return jsonify({'Price': prediction})
28
 
 
8
  # @sapp.get('/')
9
  # def home():
10
  # return "Welcome to the Supermarket Product Price Predictor!"
 
 
11
  # Define an endpoint
12
  ##@app.post('/v1/price')
13
+ @sapp.post('/price')
14
  def predict_price():
15
  # Get JSON data from the request
16
  input_json = request.get_json()
 
17
  # Convert the extracted data into a DataFrame
18
  input_data = pd.DataFrame([input_json])
 
19
  # Make a churn prediction using the trained model
20
  prediction = model.predict(input_data)
 
21
  # Return the prediction as a JSON response
22
  return jsonify({'Price': prediction})
23