Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -67,9 +67,12 @@ def predict_capacity():
|
|
| 67 |
@app.post('/v1/predict_batch')
|
| 68 |
def predict_capacity_batch():
|
| 69 |
try:
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
| 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)
|