simonschoe commited on
Commit
f746c89
β€’
1 Parent(s): 2a728c7

enables interactive examples

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. __pycache__/app.cpython-38.pyc +0 -0
  3. app.py +12 -3
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ“²πŸ“Š
4
  colorFrom: blue
5
  colorTo: green
6
  sdk: gradio
7
- sdk_version: 3.0.24
8
  app_file: app.py
9
  models: call2vec
10
  pinned: true
 
4
  colorFrom: blue
5
  colorTo: green
6
  sdk: gradio
7
+ sdk_version: 3.1.3
8
  app_file: app.py
9
  models: call2vec
10
  pinned: true
__pycache__/app.cpython-38.pyc ADDED
Binary file (5.02 kB). View file
 
app.py CHANGED
@@ -79,13 +79,22 @@ with app:
79
  text_in = gr.Textbox(lines=1, placeholder="Insert text", label="Search Query")
80
  with gr.Row():
81
  n = gr.Slider(value=50, minimum=5, maximum=250, step=5, label="Number of Neighbours")
82
- compute_bt = gr.Button("Start\nSearch")
83
  df_out = gr.Dataframe(interactive=False)
84
  f_out = gr.File(interactive=False, label="Download")
 
 
 
 
 
 
 
85
  gr.Markdown(
86
  """
87
- <div style='text-align: center;'>Call2Vec by X and Y</center></div>
88
- <p class="aligncenter"><img 'id="visitor-badge" alt="visitor badge" src="https://visitor-badge.glitch.me/badge?page_id=simonschoe.call2vec&left_color=green&right_color=blue" /></p>
 
 
89
  """
90
  )
91
  compute_bt.click(semantic_search, inputs=[text_in, n], outputs=[df_out, f_out, text_in])
 
79
  text_in = gr.Textbox(lines=1, placeholder="Insert text", label="Search Query")
80
  with gr.Row():
81
  n = gr.Slider(value=50, minimum=5, maximum=250, step=5, label="Number of Neighbours")
82
+ compute_bt = gr.Button("Search")
83
  df_out = gr.Dataframe(interactive=False)
84
  f_out = gr.File(interactive=False, label="Download")
85
+ gr.Examples(
86
+ examples = [["transformation", 3], ["climate_change", 3], ["risk, political_risk, uncertainty", 5]],
87
+ inputs = [text_in, n],
88
+ outputs = [df_out, f_out, text_in],
89
+ fn = semantic_search,
90
+ cache_examples=True
91
+ )
92
  gr.Markdown(
93
  """
94
+ <p style="text-align: center;">
95
+ Call2Vec by X and Y
96
+ img 'id="visitor-badge" alt="visitor badge" src="https://visitor-badge.glitch.me/badge?page_id=simonschoe.call2vec&left_color=green&right_color=blue" />
97
+ </p>
98
  """
99
  )
100
  compute_bt.click(semantic_search, inputs=[text_in, n], outputs=[df_out, f_out, text_in])