Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -60,9 +60,8 @@ def predict_sales_batch():
|
|
| 60 |
predicted_sales = [round(float(sales),2) for sales in model.predict(input_data).tolist()]
|
| 61 |
|
| 62 |
# Create a dictionary of predictions with Product ID and Predicted sales
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
output_dict = dict(predicted_sales) # Sales value
|
| 66 |
|
| 67 |
# Return the predictions dictionary as a JSON response
|
| 68 |
return output_dict
|
|
|
|
| 60 |
predicted_sales = [round(float(sales),2) for sales in model.predict(input_data).tolist()]
|
| 61 |
|
| 62 |
# Create a dictionary of predictions with Product ID and Predicted sales
|
| 63 |
+
product_id = input_data['Product_ID'].tolist() # Assuming id as the key or product id
|
| 64 |
+
output_dict = dict(zip(product_id, predicted_sales)) # Sales value
|
|
|
|
| 65 |
|
| 66 |
# Return the predictions dictionary as a JSON response
|
| 67 |
return output_dict
|