Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -133,6 +133,7 @@ def retrieve_gradio(knowledge_base: str, query: str, topk: int):
|
|
133 |
|
134 |
doc_list = [f for f in os.listdir(target_cache_dir) if f.endswith('.npy')]
|
135 |
doc_list = sorted(doc_list)
|
|
|
136 |
|
137 |
query_with_instruction = "Represent this query for retrieving relevant document: " + query
|
138 |
with torch.no_grad():
|
|
|
133 |
|
134 |
doc_list = [f for f in os.listdir(target_cache_dir) if f.endswith('.npy')]
|
135 |
doc_list = sorted(doc_list)
|
136 |
+
doc_reps = [np.load(os.path.join(target_cache_dir, f)) for f in doc_list]
|
137 |
|
138 |
query_with_instruction = "Represent this query for retrieving relevant document: " + query
|
139 |
with torch.no_grad():
|