Update app.py
Browse files
app.py
CHANGED
@@ -48,10 +48,10 @@ with gr.Blocks() as demo:
|
|
48 |
|
49 |
df_output = gr.Dataframe(label="Similarity Results", wrap=True)
|
50 |
|
51 |
-
def search(query):
|
52 |
query_embedding = model.encode([query], convert_to_tensor=True)
|
53 |
return perform_similarity_search(query_embedding, embeddings, space_ids, descriptions, top_k=num_results)
|
54 |
|
55 |
-
input.submit(search, inputs=input, outputs=df_output)
|
56 |
|
57 |
demo.launch()
|
|
|
48 |
|
49 |
df_output = gr.Dataframe(label="Similarity Results", wrap=True)
|
50 |
|
51 |
+
def search(query, num_results):
|
52 |
query_embedding = model.encode([query], convert_to_tensor=True)
|
53 |
return perform_similarity_search(query_embedding, embeddings, space_ids, descriptions, top_k=num_results)
|
54 |
|
55 |
+
input.submit(search, inputs=[input, num_results], outputs=df_output)
|
56 |
|
57 |
demo.launch()
|