espejelomar
commited on
Commit
•
9ec02db
1
Parent(s):
3cefacf
Update backend/inference.py
Browse files- backend/inference.py +6 -2
backend/inference.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
import torch
|
2 |
-
|
|
|
|
|
3 |
|
4 |
# Search
|
5 |
def query_search(query: str, n_answers: int, model_name: str):
|
@@ -20,6 +22,8 @@ def query_search(query: str, n_answers: int, model_name: str):
|
|
20 |
|
21 |
corpus_texts["Similarity"] = hits.tolist()
|
22 |
|
|
|
|
|
23 |
return corpus_texts.sort_values(by="Similarity", ascending=False).head(n_answers)[
|
24 |
-
["
|
25 |
]
|
|
|
1 |
import torch
|
2 |
+
|
3 |
+
from backend.utils import load_embeddings, load_model, load_texts
|
4 |
+
|
5 |
|
6 |
# Search
|
7 |
def query_search(query: str, n_answers: int, model_name: str):
|
|
|
22 |
|
23 |
corpus_texts["Similarity"] = hits.tolist()
|
24 |
|
25 |
+
print(corpus_texts)
|
26 |
+
|
27 |
return corpus_texts.sort_values(by="Similarity", ascending=False).head(n_answers)[
|
28 |
+
["func_documentation_string", "repository_name", "func_code_url"]
|
29 |
]
|