Neurolingua commited on
Commit
30cfa3d
1 Parent(s): 6510aba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -40,13 +40,21 @@ def whatsapp_webhook():
40
 
41
  filepath = convert_img(media_url, account_sid, auth_token)
42
 
43
-
 
 
 
 
 
 
 
 
44
 
45
- if predict_disease(filepath):
46
 
47
- response_text = predict_disease(filepath)
48
- elif predict_pest(filepath):
49
- response_text=predict_pest(filepath)
50
  else:
51
  response_text = "Please upload other image with good quality."
52
 
 
40
 
41
  filepath = convert_img(media_url, account_sid, auth_token)
42
 
43
+ try:
44
+ disease =predict_disease(filepath)
45
+ except:
46
+ disease=None
47
+
48
+ try:
49
+ pest=predict_pest(filepath)
50
+ except:
51
+ pest=None
52
 
53
+ if disease:
54
 
55
+ response_text = disease
56
+ elif pest:
57
+ response_text=pest
58
  else:
59
  response_text = "Please upload other image with good quality."
60