Update app.py
Browse files
app.py
CHANGED
@@ -86,12 +86,11 @@ def query(prompt, is_negative=False, gpt=True, model="DALL-E 3 XL", steps=30, cf
|
|
86 |
print(f"Error: {response.status_code} - {response.text}")
|
87 |
API_TOKEN = random.choice([os.getenv("HF_READ_TOKEN"), os.getenv("HF_READ_TOKEN_2"), os.getenv("HF_READ_TOKEN_3"), os.getenv("HF_READ_TOKEN_4"), os.getenv("HF_READ_TOKEN_5")]) # it is free
|
88 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
89 |
-
language = detect(
|
90 |
|
91 |
if language != 'en':
|
92 |
-
|
93 |
-
|
94 |
-
print(f'\033[1mГенерация {key} перевод:\033[0m {prompt}')
|
95 |
|
96 |
prompt = f"{prompt} | ultra detail, ultra elaboration, ultra quality, perfect."
|
97 |
print(f'\033[1mГенерация {key}:\033[0m {prompt}')
|
|
|
86 |
print(f"Error: {response.status_code} - {response.text}")
|
87 |
API_TOKEN = random.choice([os.getenv("HF_READ_TOKEN"), os.getenv("HF_READ_TOKEN_2"), os.getenv("HF_READ_TOKEN_3"), os.getenv("HF_READ_TOKEN_4"), os.getenv("HF_READ_TOKEN_5")]) # it is free
|
88 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
89 |
+
language = detect(is_negative)
|
90 |
|
91 |
if language != 'en':
|
92 |
+
is_negative = GoogleTranslator(source=language, target='en').translate(is_negative)
|
93 |
+
print(f'\033[1mГенерация {key} перевод negative:\033[0m {is_negative}')
|
|
|
94 |
|
95 |
prompt = f"{prompt} | ultra detail, ultra elaboration, ultra quality, perfect."
|
96 |
print(f'\033[1mГенерация {key}:\033[0m {prompt}')
|