davidberenstein1957 HF staff commited on
Commit
a442ffd
1 Parent(s): 7e27e2f

feat: simplify steps

Browse files
Files changed (1) hide show
  1. app.py +3 -14
app.py CHANGED
@@ -79,9 +79,6 @@ with gr.Blocks() as demo:
79
  You can search for the nearest neighbors of a query vector, or
80
  perform a similarity search on a dataframe.
81
  </p>
82
- <p>
83
- This app uses the <a href="https://huggingface.co/minishlab/M2V_multilingual_output">M2V_multilingual_output</a> model from the Hugging Face Hub.
84
- </p>
85
  """
86
  )
87
  with gr.Row():
@@ -101,7 +98,8 @@ with gr.Blocks() as demo:
101
  with gr.Row(variant="panel"):
102
  split_dropdown = gr.Dropdown(label="Select a split")
103
  column_dropdown = gr.Dropdown(label="Select a column")
104
- btn_vectorize_dataset = gr.Button("Vectorize")
 
105
 
106
  btn_load_dataset.click(
107
  load_dataset_from_hub, inputs=search_in, show_progress=True
@@ -110,16 +108,7 @@ with gr.Blocks() as demo:
110
  )
111
  split_dropdown.change(
112
  fn=get_columns, inputs=split_dropdown, outputs=column_dropdown
113
- )
114
-
115
- btn_vectorize_dataset.click(
116
- fn=vectorize_dataset,
117
- inputs=[split_dropdown, column_dropdown],
118
- show_progress=True,
119
- )
120
-
121
- with gr.Row(variant="panel"):
122
- query_input = gr.Textbox(label="Query")
123
 
124
  btn_run = gr.Button("Run")
125
  results_output = gr.Dataframe(label="Results")
 
79
  You can search for the nearest neighbors of a query vector, or
80
  perform a similarity search on a dataframe.
81
  </p>
 
 
 
82
  """
83
  )
84
  with gr.Row():
 
98
  with gr.Row(variant="panel"):
99
  split_dropdown = gr.Dropdown(label="Select a split")
100
  column_dropdown = gr.Dropdown(label="Select a column")
101
+ with gr.Row(variant="panel"):
102
+ query_input = gr.Textbox(label="Query")
103
 
104
  btn_load_dataset.click(
105
  load_dataset_from_hub, inputs=search_in, show_progress=True
 
108
  )
109
  split_dropdown.change(
110
  fn=get_columns, inputs=split_dropdown, outputs=column_dropdown
111
+ ).then(fn=vectorize_dataset, inputs=[split_dropdown, column_dropdown])
 
 
 
 
 
 
 
 
 
112
 
113
  btn_run = gr.Button("Run")
114
  results_output = gr.Dataframe(label="Results")