Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -70,7 +70,7 @@ def get_definition_and_image(word):
|
|
70 |
return None, None
|
71 |
|
72 |
# Function to randomly sample a noun or verb
|
73 |
-
def sample_word_and_display_info():
|
74 |
is_noun = random.choice([True, False]) # Randomly choose noun or verb
|
75 |
if is_noun:
|
76 |
pos = "n"
|
@@ -99,9 +99,10 @@ with gr.Blocks() as demo:
|
|
99 |
print(image, text)
|
100 |
with gr.Row():
|
101 |
img_1= gr.Image(label="image")
|
|
|
102 |
text_1 = gr.Markdown(label="text")
|
103 |
button = gr.Button(label="Update Text")
|
104 |
-
button.click(sample_word_and_display_info,inputs=
|
105 |
demo.launch()
|
106 |
|
107 |
|
|
|
70 |
return None, None
|
71 |
|
72 |
# Function to randomly sample a noun or verb
|
73 |
+
def sample_word_and_display_info(dummy):
|
74 |
is_noun = random.choice([True, False]) # Randomly choose noun or verb
|
75 |
if is_noun:
|
76 |
pos = "n"
|
|
|
99 |
print(image, text)
|
100 |
with gr.Row():
|
101 |
img_1= gr.Image(label="image")
|
102 |
+
inp = gr.Textbox(placeholder="What is your name?")
|
103 |
text_1 = gr.Markdown(label="text")
|
104 |
button = gr.Button(label="Update Text")
|
105 |
+
button.click(sample_word_and_display_info,inputs=inp, outputs=text_1)
|
106 |
demo.launch()
|
107 |
|
108 |
|