Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -131,7 +131,7 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
|
|
| 131 |
if response.status_code != 200:
|
| 132 |
print(f"Ошибка: Не удалось получить изображение. Статус ответа: {response.status_code}")
|
| 133 |
print(f"Содержимое ответа: {response.text}")
|
| 134 |
-
return
|
| 135 |
|
| 136 |
try:
|
| 137 |
image_bytes = response.content
|
|
@@ -140,7 +140,7 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
|
|
| 140 |
return image
|
| 141 |
except Exception as e:
|
| 142 |
print(f"Ошибка при попытке открыть изображение: {e}")
|
| 143 |
-
return
|
| 144 |
|
| 145 |
css = """
|
| 146 |
* {}
|
|
|
|
| 131 |
if response.status_code != 200:
|
| 132 |
print(f"Ошибка: Не удалось получить изображение. Статус ответа: {response.status_code}")
|
| 133 |
print(f"Содержимое ответа: {response.text}")
|
| 134 |
+
return gr.update(error=f"{response.status_code} : {response.text}")
|
| 135 |
|
| 136 |
try:
|
| 137 |
image_bytes = response.content
|
|
|
|
| 140 |
return image
|
| 141 |
except Exception as e:
|
| 142 |
print(f"Ошибка при попытке открыть изображение: {e}")
|
| 143 |
+
return None
|
| 144 |
|
| 145 |
css = """
|
| 146 |
* {}
|