Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,9 @@ import os
|
|
6 |
import tempfile
|
7 |
import mimetypes
|
8 |
|
9 |
-
TOKEN = os.getenv("
|
10 |
API_URL = os.getenv("API_URL")
|
11 |
-
token_id =
|
12 |
tokens_tried = 0
|
13 |
no_of_accounts = 11
|
14 |
model_id = os.getenv("MODEL_ID")
|
@@ -47,7 +47,7 @@ def generate_image(prompt, aspect_ratio, realism):
|
|
47 |
if "error" in response_data:
|
48 |
if 'error 429' in response_data['error']:
|
49 |
if tokens_tried < no_of_accounts:
|
50 |
-
token_id = (token_id + 1) % (no_of_accounts
|
51 |
tokens_tried += 1
|
52 |
TOKEN = os.getenv(f"TOKEN{token_id}")
|
53 |
response_data = generate_image(prompt, aspect_ratio, realism)
|
|
|
6 |
import tempfile
|
7 |
import mimetypes
|
8 |
|
9 |
+
TOKEN = os.getenv("TOKEN0")
|
10 |
API_URL = os.getenv("API_URL")
|
11 |
+
token_id = 0
|
12 |
tokens_tried = 0
|
13 |
no_of_accounts = 11
|
14 |
model_id = os.getenv("MODEL_ID")
|
|
|
47 |
if "error" in response_data:
|
48 |
if 'error 429' in response_data['error']:
|
49 |
if tokens_tried < no_of_accounts:
|
50 |
+
token_id = (token_id + 1) % (no_of_accounts)
|
51 |
tokens_tried += 1
|
52 |
TOKEN = os.getenv(f"TOKEN{token_id}")
|
53 |
response_data = generate_image(prompt, aspect_ratio, realism)
|