gauravsahu1990 commited on
Commit
73544cf
·
verified ·
1 Parent(s): 1c2785f

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -67,9 +67,12 @@ def predict_capacity():
67
  @app.post('/v1/predict_batch')
68
  def predict_capacity_batch():
69
  try:
70
- input_json = request.get_json()
71
- data_list = input_json.get("data", [])
72
- input_data = pd.DataFrame(data_list)
 
 
 
73
  input_data["Date"] = pd.to_datetime(input_data["Date"])
74
 
75
  logger.info("Batch input shape: %s", input_data.shape)
 
67
  @app.post('/v1/predict_batch')
68
  def predict_capacity_batch():
69
  try:
70
+ # Get the uploaded CSV file from the request
71
+ file = request.files['file']
72
+
73
+ # Read the file into a DataFrame
74
+ input_data = pd.read_csv(file)
75
+ #input_data = pd.DataFrame(data_list)
76
  input_data["Date"] = pd.to_datetime(input_data["Date"])
77
 
78
  logger.info("Batch input shape: %s", input_data.shape)