Muhammad Abdiel Al Hafiz commited on
Commit
e9ff5ea
·
1 Parent(s): 1774c0b

just trying to fix

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -22,7 +22,9 @@ def get_disease_detail(disease_name):
22
  "Reminder: Always seek professional help, such as a doctor."
23
  )
24
  response = genai.GenerativeModel("gemini-1.5-flash").generate_content(prompt)
25
- return response.candidates[0]['output'] if response.candidates else "No explanation available."
 
 
26
 
27
  def predict_image(image):
28
  image_resized = image.resize((224, 224))
 
22
  "Reminder: Always seek professional help, such as a doctor."
23
  )
24
  response = genai.GenerativeModel("gemini-1.5-flash").generate_content(prompt)
25
+
26
+ # Safely extract text from response (without using candidates)
27
+ return response.result if hasattr(response, 'result') else "No explanation available."
28
 
29
  def predict_image(image):
30
  image_resized = image.resize((224, 224))