Spaces:
SHOOL45
/
Runtime error

Rooni commited on
Commit
c4994d7
1 Parent(s): e65f3e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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(prompt)
90
 
91
  if language != 'en':
92
- if model != 'DALL-E 3 XL':
93
- prompt = GoogleTranslator(source=language, target='en').translate(prompt)
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}')