Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -27,8 +27,6 @@ mmodels = {
|
|
27 |
"CleanLinearMix": "https://api-inference.huggingface.co/models/digiplay/CleanLinearMix_nsfw",
|
28 |
"Redmond SDXL": "https://api-inference.huggingface.co/models/artificialguybr/LogoRedmond-LogoLoraForSDXL-V2"
|
29 |
}
|
30 |
-
API_TOKEN = os.getenv("HF_READ_TOKEN")
|
31 |
-
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
32 |
timeout = 100
|
33 |
# PLEASE ❤ like ❤ this space. Please like me. I am 12 years old, one of my projects is: https://ai-hub.rf.gd . I live in Russia, I don't know English very well. Therefore, I apologize that there is only Russian here, but I think it will not be difficult to translate all this. (For example, using gpt)
|
34 |
|
@@ -82,10 +80,8 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
|
|
82 |
else:
|
83 |
# Если произошла ошибка, возвращаем сообщение об ошибке
|
84 |
print(f"Error: {response.status_code} - {response.text}")
|
85 |
-
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")])
|
86 |
-
headers = {
|
87 |
-
'Authorization': f'Bearer {API_TOKEN}'
|
88 |
-
}
|
89 |
prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
|
90 |
print(f'\033[1mГенерация {key} перевод:\033[0m {prompt}')
|
91 |
|
|
|
27 |
"CleanLinearMix": "https://api-inference.huggingface.co/models/digiplay/CleanLinearMix_nsfw",
|
28 |
"Redmond SDXL": "https://api-inference.huggingface.co/models/artificialguybr/LogoRedmond-LogoLoraForSDXL-V2"
|
29 |
}
|
|
|
|
|
30 |
timeout = 100
|
31 |
# PLEASE ❤ like ❤ this space. Please like me. I am 12 years old, one of my projects is: https://ai-hub.rf.gd . I live in Russia, I don't know English very well. Therefore, I apologize that there is only Russian here, but I think it will not be difficult to translate all this. (For example, using gpt)
|
32 |
|
|
|
80 |
else:
|
81 |
# Если произошла ошибка, возвращаем сообщение об ошибке
|
82 |
print(f"Error: {response.status_code} - {response.text}")
|
83 |
+
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
|
84 |
+
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
|
|
|
|
85 |
prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
|
86 |
print(f'\033[1mГенерация {key} перевод:\033[0m {prompt}')
|
87 |
|