aravindshaz3 commited on
Commit
d40d3e9
·
verified ·
1 Parent(s): 45cfc3b

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app.py +4 -2
  2. requirements.txt +1 -0
app.py CHANGED
@@ -14,7 +14,8 @@ def home():
14
  return "Welcome to the Forecasting Model API!"
15
 
16
  # Single prediction endpoint
17
- @app.post('/v1/params')
 
18
  def predict_sales():
19
  # Get JSON data from the request
20
  input_dict = request.get_json()
@@ -43,7 +44,8 @@ def predict_sales():
43
  return jsonify({'Prediction': prediction})
44
 
45
  # Batch prediction endpoint
46
- @app.post('/v1/paramsbatch')
 
47
  def predict_sales_batch():
48
  # Get uploaded CSV file
49
  file = request.files['file']
 
14
  return "Welcome to the Forecasting Model API!"
15
 
16
  # Single prediction endpoint
17
+ #@app.post('/v1/params')
18
+ @app.route('/v1/params', methods=['POST'])
19
  def predict_sales():
20
  # Get JSON data from the request
21
  input_dict = request.get_json()
 
44
  return jsonify({'Prediction': prediction})
45
 
46
  # Batch prediction endpoint
47
+ #@app.post('/v1/paramsbatch')
48
+ @app.route('/v1/paramsbatch', methods=['POST'])
49
  def predict_sales_batch():
50
  # Get uploaded CSV file
51
  file = request.files['file']
requirements.txt CHANGED
@@ -9,3 +9,4 @@ gunicorn==20.1.0
9
  requests==2.28.1
10
  uvicorn[standard]
11
  streamlit==1.43.2
 
 
9
  requests==2.28.1
10
  uvicorn[standard]
11
  streamlit==1.43.2
12
+ flask>=2.0