mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-16 02:25:51 +08:00
commit
4191ec692e
@ -818,7 +818,9 @@ class RerankCompressor(BaseDocumentCompressor):
|
|||||||
)
|
)
|
||||||
scores = util.cos_sim(query_embedding, document_embedding)[0]
|
scores = util.cos_sim(query_embedding, document_embedding)[0]
|
||||||
|
|
||||||
docs_with_scores = list(zip(documents, scores.tolist()))
|
docs_with_scores = list(
|
||||||
|
zip(documents, scores.tolist() if not isinstance(scores, list) else scores)
|
||||||
|
)
|
||||||
if self.r_score:
|
if self.r_score:
|
||||||
docs_with_scores = [
|
docs_with_scores = [
|
||||||
(d, s) for d, s in docs_with_scores if s >= self.r_score
|
(d, s) for d, s in docs_with_scores if s >= self.r_score
|
||||||
|
Loading…
x
Reference in New Issue
Block a user