shivalikasingh commited on
Commit
cd98abf
·
verified ·
1 Parent(s): 800535d

Update aya_vision_utils.py

Browse files
Files changed (1) hide show
  1. aya_vision_utils.py +6 -4
aya_vision_utils.py CHANGED
@@ -54,13 +54,15 @@ def get_aya_vision_response(incoming_message, image_filepath, max_size_mb=5):
54
  print("image_filepath:", image_filepath)
55
  max_size_bytes = max_size_mb * 1024 * 1024
56
 
57
- if image_filepath.endswith(".jpg") or image_filepath.endswith('.jpeg'):
 
 
58
  image_type="image/jpeg"
59
- elif image_filepath.endswith(".png"):
60
  image_type = "image/png"
61
- elif image_filepath.endswith(".webp"):
62
  image_type="image/webp"
63
- elif image_filepath.endswith(".gif"):
64
  image_type="image/gif"
65
 
66
  response=""
 
54
  print("image_filepath:", image_filepath)
55
  max_size_bytes = max_size_mb * 1024 * 1024
56
 
57
+ image_ext = image_filepath.lower()
58
+
59
+ if image_ext.endswith(".jpg") or image_ext.endswith('.jpeg'):
60
  image_type="image/jpeg"
61
+ elif image_ext.endswith(".png"):
62
  image_type = "image/png"
63
+ elif image_ext.endswith(".webp"):
64
  image_type="image/webp"
65
+ elif image_ext.endswith(".gif"):
66
  image_type="image/gif"
67
 
68
  response=""