1MR commited on
Commit
871f16e
·
verified ·
1 Parent(s): d74864e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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} and give tips for making it healthier."
121
  health_benefits_and_tips = call_llm(llm_client, health_benefits_prompt)
122
 
123
  return {
124
  "predicted_label": prediction,
125
- "nutrition_info": nutrition_info,
126
- "health_benefits_and_tips": health_benefits_and_tips
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(