Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,7 +104,7 @@ async def predict_image_and_nutrition(file: UploadFile = File(...)):
|
|
| 104 |
return json.loads(response.decode())[0]["generated_text"]
|
| 105 |
|
| 106 |
# Use the prediction to generate nutrition information
|
| 107 |
-
prompt = f"Nutrition information for {prediction} in formatted list"
|
| 108 |
response = call_llm(llm_client, prompt)
|
| 109 |
|
| 110 |
return {"predicted_label": prediction, "nutrition_info": response}
|
|
|
|
| 104 |
return json.loads(response.decode())[0]["generated_text"]
|
| 105 |
|
| 106 |
# Use the prediction to generate nutrition information
|
| 107 |
+
prompt = f"Nutrition information (Calories, Protein, Carbohydrates, Dietary Fiber, Sugars, Fat, Sodium, Potassium, Vitamin C, Vitamin B6, Folate, Niacin, Pantothenic acid) for {prediction} in formatted list"
|
| 108 |
response = call_llm(llm_client, prompt)
|
| 109 |
|
| 110 |
return {"predicted_label": prediction, "nutrition_info": response}
|