Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,11 +36,11 @@ def get_code(query):
|
|
36 |
truncate="LEFT").embeddings
|
37 |
|
38 |
# Retrieve the nearest neighbors
|
39 |
-
similar_item_ids = search_index.get_nns_by_vector(query_embed[0],
|
40 |
|
41 |
|
42 |
return data_df.iloc[similar_item_ids[0]]['function_body'], data_df.iloc[similar_item_ids[0]]['file_path']
|
43 |
-
examples = ['compute diffusion of given data'
|
44 |
inputs = gr.Textbox(label='query')
|
45 |
outputs = [gr.Textbox(label='matched function'), gr.Textbox(label='File path')]
|
46 |
title = "Search Code"
|
|
|
36 |
truncate="LEFT").embeddings
|
37 |
|
38 |
# Retrieve the nearest neighbors
|
39 |
+
similar_item_ids = search_index.get_nns_by_vector(query_embed[0],1)
|
40 |
|
41 |
|
42 |
return data_df.iloc[similar_item_ids[0]]['function_body'], data_df.iloc[similar_item_ids[0]]['file_path']
|
43 |
+
examples = ['compute diffusion of given data']
|
44 |
inputs = gr.Textbox(label='query')
|
45 |
outputs = [gr.Textbox(label='matched function'), gr.Textbox(label='File path')]
|
46 |
title = "Search Code"
|