Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -106,8 +106,8 @@ async def predict_image_and_nutrition(file: UploadFile = File(...)):
|
|
| 106 |
return json.loads(response.decode())[0]["generated_text"]
|
| 107 |
|
| 108 |
# Use the prediction to generate nutrition information
|
| 109 |
-
|
| 110 |
-
prompt = f"Provide all the nutrition information for {prediction}, including Calories, Protein, Carbohydrates, Dietary Fiber, Sugars, Fat, Sodium, Potassium, Vitamin C, Vitamin B6, Folate, Niacin, and Pantothenic acid. Please present the information in a clear, formatted list only, without additional explanations."
|
| 111 |
response = call_llm(llm_client, prompt)
|
| 112 |
|
| 113 |
return {"predicted_label": prediction, "nutrition_info": response}
|
|
|
|
| 106 |
return json.loads(response.decode())[0]["generated_text"]
|
| 107 |
|
| 108 |
# Use the prediction to generate nutrition information
|
| 109 |
+
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"
|
| 110 |
+
# prompt = f"Provide all the nutrition information for {prediction}, including Calories, Protein, Carbohydrates, Dietary Fiber, Sugars, Fat, Sodium, Potassium, Vitamin C, Vitamin B6, Folate, Niacin, and Pantothenic acid. Please present the information in a clear, formatted list only, without additional explanations."
|
| 111 |
response = call_llm(llm_client, prompt)
|
| 112 |
|
| 113 |
return {"predicted_label": prediction, "nutrition_info": response}
|