Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,9 @@ def get_definition_and_image(word):
|
|
49 |
# URL for the ImageNet API
|
50 |
base_url = "http://www.image-net.org/api/text/imagenet.synset.geturls?wnid="
|
51 |
|
52 |
-
|
|
|
|
|
53 |
url = base_url + synset_id
|
54 |
|
55 |
# Send a GET request to the URL
|
|
|
49 |
# URL for the ImageNet API
|
50 |
base_url = "http://www.image-net.org/api/text/imagenet.synset.geturls?wnid="
|
51 |
|
52 |
+
if not synset_id: return None,None
|
53 |
+
|
54 |
+
# Cofrom PIL import Image mbine the base URL and the synset ID to get a list of image URLs
|
55 |
url = base_url + synset_id
|
56 |
|
57 |
# Send a GET request to the URL
|