Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,8 +65,11 @@ def generate_cached_image(cache_key, prompt, width, height, seed, model_name):
|
|
| 65 |
image_data = response.content
|
| 66 |
image = Image.open(io.BytesIO(image_data))
|
| 67 |
return image
|
| 68 |
-
except requests.exceptions.
|
| 69 |
-
app.logger.error(f"
|
|
|
|
|
|
|
|
|
|
| 70 |
return None
|
| 71 |
|
| 72 |
@app.route('/prompt/<path:prompt>')
|
|
|
|
| 65 |
image_data = response.content
|
| 66 |
image = Image.open(io.BytesIO(image_data))
|
| 67 |
return image
|
| 68 |
+
except requests.exceptions.HTTPError as http_err:
|
| 69 |
+
app.logger.error(f"HTTP error occurred: {http_err} - Response: {response.text}")
|
| 70 |
+
return None
|
| 71 |
+
except requests.exceptions.RequestException as req_err:
|
| 72 |
+
app.logger.error(f"Request error occurred: {req_err}")
|
| 73 |
return None
|
| 74 |
|
| 75 |
@app.route('/prompt/<path:prompt>')
|