artintel235 commited on
Commit
d0756ed
·
verified ·
1 Parent(s): dae578e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -39,8 +39,10 @@ async def generate_image_async(prompt, aspect_ratio):
39
  if "error" in response_data:
40
  if 'error 429' in response_data['error']:
41
  if glif_tokens_tried<no_of_accounts:
42
- global glif_token_id = (glif_token_id+1)%no_of_accounts
43
- global GLIF_API_TOKEN = os.getenv(f"GLIF_API_TOKEN{glif_token_id}")
 
 
44
  response_data = await generate_image_async(prompt, aspect_ratio)
45
  glif_tokens_tried = 0
46
  response_data = "No credits available"
 
39
  if "error" in response_data:
40
  if 'error 429' in response_data['error']:
41
  if glif_tokens_tried<no_of_accounts:
42
+ global glif_token_id
43
+ glif_token_id = (glif_token_id+1)%no_of_accounts
44
+ global GLIF_API_TOKEN
45
+ GLIF_API_TOKEN = os.getenv(f"GLIF_API_TOKEN{glif_token_id}")
46
  response_data = await generate_image_async(prompt, aspect_ratio)
47
  glif_tokens_tried = 0
48
  response_data = "No credits available"