mylesai commited on
Commit
0f95ed0
·
1 Parent(s): 9dc673b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  from openai import OpenAI
2
  import requests
3
  import base64
@@ -53,7 +55,7 @@ def get_imgs_from_folder(image_files, zipfile):
53
 
54
  return image_files
55
 
56
-
57
  def get_seo_tags(image_path, topical_map, attempts=0):
58
  '''
59
  Gets the seo tags and topic/sub-topic classification for an image using OpenAI GPT-4 Vision Preview
 
1
+ import backoff
2
+ import openai
3
  from openai import OpenAI
4
  import requests
5
  import base64
 
55
 
56
  return image_files
57
 
58
+ @backoff.on_exception(backoff.expo, openai.RateLimitError)
59
  def get_seo_tags(image_path, topical_map, attempts=0):
60
  '''
61
  Gets the seo tags and topic/sub-topic classification for an image using OpenAI GPT-4 Vision Preview