Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,7 +59,6 @@ def read_root():
|
|
| 59 |
def test_post(item: Item):
|
| 60 |
return {"message": f"Received item '{item.name}' with quantity {item.quantity}"}
|
| 61 |
|
| 62 |
-
|
| 63 |
@app.post("/predict")
|
| 64 |
def predict(input_data: UserInput):
|
| 65 |
try:
|
|
@@ -81,7 +80,8 @@ def predict(input_data: UserInput):
|
|
| 81 |
'child': user_dict['family']['child'],
|
| 82 |
'consumption': v['predicted_consumption'],
|
| 83 |
'finish_error': v['predicted_finish_error'],
|
| 84 |
-
'finish_days': v['predicted_finish_days']
|
|
|
|
| 85 |
} for k, v in predictions.items()])
|
| 86 |
|
| 87 |
model.insert_feedback(user_id, feedback)
|
|
|
|
| 59 |
def test_post(item: Item):
|
| 60 |
return {"message": f"Received item '{item.name}' with quantity {item.quantity}"}
|
| 61 |
|
|
|
|
| 62 |
@app.post("/predict")
|
| 63 |
def predict(input_data: UserInput):
|
| 64 |
try:
|
|
|
|
| 80 |
'child': user_dict['family']['child'],
|
| 81 |
'consumption': v['predicted_consumption'],
|
| 82 |
'finish_error': v['predicted_finish_error'],
|
| 83 |
+
'finish_days': v['predicted_finish_days'],
|
| 84 |
+
'stock_quantity': user_dict['stock'][k] # <--- Added stock quantity here
|
| 85 |
} for k, v in predictions.items()])
|
| 86 |
|
| 87 |
model.insert_feedback(user_id, feedback)
|