Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -117,13 +117,13 @@ async def predict_image_and_nutrition(file: UploadFile = File(...)):
|
|
| 117 |
nutrition_info = call_llm(llm_client, nutrition_prompt)
|
| 118 |
|
| 119 |
# Second prompt: Health benefits and tips
|
| 120 |
-
health_benefits_prompt = f"Provide the health benefits and considerations for {prediction}
|
| 121 |
health_benefits_and_tips = call_llm(llm_client, health_benefits_prompt)
|
| 122 |
|
| 123 |
return {
|
| 124 |
"predicted_label": prediction,
|
| 125 |
-
"
|
| 126 |
-
"
|
| 127 |
}
|
| 128 |
except Exception as e:
|
| 129 |
return JSONResponse(
|
|
|
|
| 117 |
nutrition_info = call_llm(llm_client, nutrition_prompt)
|
| 118 |
|
| 119 |
# Second prompt: Health benefits and tips
|
| 120 |
+
health_benefits_prompt = f"Provide the health benefits and considerations for {prediction}. Additionally, include practical tips for making {prediction} healthier. Keep the response focused on these two aspects only."
|
| 121 |
health_benefits_and_tips = call_llm(llm_client, health_benefits_prompt)
|
| 122 |
|
| 123 |
return {
|
| 124 |
"predicted_label": prediction,
|
| 125 |
+
"health_benefits_and_tips": health_benefits_and_tips,
|
| 126 |
+
"nutrition_info": nutrition_info
|
| 127 |
}
|
| 128 |
except Exception as e:
|
| 129 |
return JSONResponse(
|