thak123 commited on
Commit
b911d1f
·
1 Parent(s): e52febb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 + ":" + synset_id.definition() or ""
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
- inp = gr.Textbox(placeholder="What is your name?")
69
  text_1 = gr.Textbox(label="text")
70
  button = gr.Button(label="Update Text")
71
- button.click(sample_word_and_display_info,inputs=inp, outputs=text_1)
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