Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -64,7 +64,7 @@ def get_definition_and_image(word):
|
|
64 |
# Print the first 10 image URLs
|
65 |
for i, url in enumerate(image_urls[:10], start=1):
|
66 |
print(f"Image {i}: {url}")
|
67 |
-
return word, image_urls[0]
|
68 |
else:
|
69 |
print(f"Failed to retrieve image URLs. Status code: {response.status_code}")
|
70 |
return None, None
|
@@ -99,7 +99,9 @@ with gr.Blocks() as demo:
|
|
99 |
print(image, text)
|
100 |
gr.Image(image)
|
101 |
gr.Markdown(text)
|
|
|
102 |
|
|
|
103 |
demo.launch()
|
104 |
|
105 |
|
|
|
64 |
# Print the first 10 image URLs
|
65 |
for i, url in enumerate(image_urls[:10], start=1):
|
66 |
print(f"Image {i}: {url}")
|
67 |
+
return word + ":" + synset_id.definition() or "" , image_urls[0]
|
68 |
else:
|
69 |
print(f"Failed to retrieve image URLs. Status code: {response.status_code}")
|
70 |
return None, None
|
|
|
99 |
print(image, text)
|
100 |
gr.Image(image)
|
101 |
gr.Markdown(text)
|
102 |
+
button = gr.Button("Update Text")
|
103 |
|
104 |
+
button.click(demo.update, inputs=[""], index=0)
|
105 |
demo.launch()
|
106 |
|
107 |
|