Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ def get_definition_and_image(word):
|
|
35 |
|
36 |
if not synset_id: return None
|
37 |
|
38 |
-
return word + "
|
39 |
|
40 |
# Function to randomly sample a noun or verb
|
41 |
def sample_word_and_display_info(dummy="dummy"):
|
@@ -65,10 +65,10 @@ with gr.Blocks() as demo:
|
|
65 |
text = sample_word_and_display_info()
|
66 |
print(text)
|
67 |
with gr.Row():
|
68 |
-
|
69 |
text_1 = gr.Textbox(label="text")
|
70 |
button = gr.Button(label="Update Text")
|
71 |
-
button.click(sample_word_and_display_info,inputs=
|
72 |
demo.launch()
|
73 |
|
74 |
|
|
|
35 |
|
36 |
if not synset_id: return None
|
37 |
|
38 |
+
return word + ":\n" + synset_id.definition() or ""
|
39 |
|
40 |
# Function to randomly sample a noun or verb
|
41 |
def sample_word_and_display_info(dummy="dummy"):
|
|
|
65 |
text = sample_word_and_display_info()
|
66 |
print(text)
|
67 |
with gr.Row():
|
68 |
+
|
69 |
text_1 = gr.Textbox(label="text")
|
70 |
button = gr.Button(label="Update Text")
|
71 |
+
button.click(sample_word_and_display_info,inputs=text_1, outputs=text_1)
|
72 |
demo.launch()
|
73 |
|
74 |
|