Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,11 +16,10 @@ from fastapi import FastAPI
|
|
| 16 |
|
| 17 |
app = FastAPI()
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
|
| 25 |
api_key = os.getenv("MISTRAL_API_KEY")
|
| 26 |
Mistralclient = Mistral(api_key=api_key)
|
|
@@ -39,7 +38,8 @@ def query(prompt, is_negative=False, steps=35, cfg_scale=7, sampler="DPM++ 2M Ka
|
|
| 39 |
|
| 40 |
key = random.randint(0, 999)
|
| 41 |
|
| 42 |
-
|
|
|
|
| 43 |
|
| 44 |
# Translate the prompt from Russian to English if necessary
|
| 45 |
prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
|
|
|
|
| 16 |
|
| 17 |
app = FastAPI()
|
| 18 |
|
| 19 |
+
API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-3.5-large"
|
| 20 |
+
API_TOKEN = os.getenv("HF_READ_TOKEN")
|
| 21 |
+
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 22 |
+
timeout = 100
|
|
|
|
| 23 |
|
| 24 |
api_key = os.getenv("MISTRAL_API_KEY")
|
| 25 |
Mistralclient = Mistral(api_key=api_key)
|
|
|
|
| 38 |
|
| 39 |
key = random.randint(0, 999)
|
| 40 |
|
| 41 |
+
API_TOKEN = random.choice([os.getenv("HF_READ_TOKEN")])
|
| 42 |
+
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 43 |
|
| 44 |
# Translate the prompt from Russian to English if necessary
|
| 45 |
prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
|