Neurolingua commited on
Commit
4749d72
1 Parent(s): ca95c4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -55,7 +55,10 @@ def whatsapp_webhook():
55
 
56
  if content_type.startswith('image/'):
57
  # Handle image processing (disease/pest detection)
58
- filepath = convert_img(media_url, account_sid, auth_token)
 
 
 
59
  bd=extract_text_from_image(filepath)
60
  if bd!='':
61
  bookdata=booktask(bd+bookdata)
@@ -126,4 +129,4 @@ def send_initial_message(to_number):
126
  if __name__ == "__main__":
127
  send_initial_message('919080522395')
128
  send_initial_message('916382792828')
129
- app.run(host='0.0.0.0', port=7860)
 
55
 
56
  if content_type.startswith('image/'):
57
  # Handle image processing (disease/pest detection)
58
+ try:
59
+ filepath = convert_img(media_url, account_sid, auth_token)
60
+ except:
61
+ filepath = convert_img(media_url, account_sid, auth_token)
62
  bd=extract_text_from_image(filepath)
63
  if bd!='':
64
  bookdata=booktask(bd+bookdata)
 
129
  if __name__ == "__main__":
130
  send_initial_message('919080522395')
131
  send_initial_message('916382792828')
132
+ app.run(host='0.0.0.0', port=7860,debug=1==1)