Spaces:
Runtime error
Runtime error
NCTCMumbai
commited on
Commit
•
f8cf0b4
1
Parent(s):
ebf26c7
Update app.py
Browse files
app.py
CHANGED
@@ -149,11 +149,11 @@ def bot(history, cross_encoder):
|
|
149 |
# Retrieve documents relevant to query
|
150 |
query_doc_pair = [[query, doc] for doc in documents]
|
151 |
if cross_encoder=='MiniLM-L6v2' :
|
152 |
-
|
153 |
elif cross_encoder=='BGE reranker':
|
154 |
-
|
155 |
|
156 |
-
cross_scores =
|
157 |
sim_scores_argsort = list(reversed(np.argsort(cross_scores)))
|
158 |
logger.warning(f'Finished cross encoder {len(documents)}')
|
159 |
|
|
|
149 |
# Retrieve documents relevant to query
|
150 |
query_doc_pair = [[query, doc] for doc in documents]
|
151 |
if cross_encoder=='MiniLM-L6v2' :
|
152 |
+
cross_encoder1 = CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2')
|
153 |
elif cross_encoder=='BGE reranker':
|
154 |
+
cross_encoder1 = CrossEncoder('BAAI/bge-reranker-base')
|
155 |
|
156 |
+
cross_scores = cross_encoder1.predict(query_doc_pair)
|
157 |
sim_scores_argsort = list(reversed(np.argsort(cross_scores)))
|
158 |
logger.warning(f'Finished cross encoder {len(documents)}')
|
159 |
|