Spaces:
Sleeping
Sleeping
Neurolingua
commited on
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
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)
|