Update app.py
Browse files
app.py
CHANGED
|
@@ -192,14 +192,14 @@ def latents_to_pil(latents):
|
|
| 192 |
#!curl --output macaw.jpg 'https://lafeber.com/pet-birds/wp-content/uploads/2018/06/Scarlet-Macaw-2.jpg'
|
| 193 |
url = 'https://lafeber.com/pet-birds/wp-content/uploads/2018/06/Scarlet-Macaw-2.jpg'
|
| 194 |
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
|
| 204 |
# Call the function if this is the main module
|
| 205 |
|
|
|
|
| 192 |
#!curl --output macaw.jpg 'https://lafeber.com/pet-birds/wp-content/uploads/2018/06/Scarlet-Macaw-2.jpg'
|
| 193 |
url = 'https://lafeber.com/pet-birds/wp-content/uploads/2018/06/Scarlet-Macaw-2.jpg'
|
| 194 |
|
| 195 |
+
try:
|
| 196 |
+
response = requests.get(url)
|
| 197 |
+
response.raise_for_status() # Raise an exception for HTTP errors
|
| 198 |
+
with open('macaw.jpg', 'wb') as file:
|
| 199 |
+
file.write(response.content)
|
| 200 |
+
print("Image downloaded successfully")
|
| 201 |
+
except requests.exceptions.RequestException as e:
|
| 202 |
+
print(f"Failed to download image: {e}")
|
| 203 |
|
| 204 |
# Call the function if this is the main module
|
| 205 |
|