mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 18:35:58 +08:00
fix: reranking disable timer error (#6910)
This commit is contained in:
parent
df530b53e5
commit
f97a51ce24
@ -322,12 +322,14 @@ class DatasetRetrieval:
|
|||||||
for thread in threads:
|
for thread in threads:
|
||||||
thread.join()
|
thread.join()
|
||||||
|
|
||||||
|
with measure_time() as timer:
|
||||||
if reranking_enable:
|
if reranking_enable:
|
||||||
# do rerank for searched documents
|
# do rerank for searched documents
|
||||||
data_post_processor = DataPostProcessor(tenant_id, reranking_mode,
|
data_post_processor = DataPostProcessor(
|
||||||
reranking_model, weights, False)
|
tenant_id, reranking_mode,
|
||||||
|
reranking_model, weights, False
|
||||||
|
)
|
||||||
|
|
||||||
with measure_time() as timer:
|
|
||||||
all_documents = data_post_processor.invoke(
|
all_documents = data_post_processor.invoke(
|
||||||
query=query,
|
query=query,
|
||||||
documents=all_documents,
|
documents=all_documents,
|
||||||
@ -339,6 +341,7 @@ class DatasetRetrieval:
|
|||||||
all_documents = self.calculate_keyword_score(query, all_documents, top_k)
|
all_documents = self.calculate_keyword_score(query, all_documents, top_k)
|
||||||
elif index_type == "high_quality":
|
elif index_type == "high_quality":
|
||||||
all_documents = self.calculate_vector_score(all_documents, top_k, score_threshold)
|
all_documents = self.calculate_vector_score(all_documents, top_k, score_threshold)
|
||||||
|
|
||||||
self._on_query(query, dataset_ids, app_id, user_from, user_id)
|
self._on_query(query, dataset_ids, app_id, user_from, user_id)
|
||||||
|
|
||||||
if all_documents:
|
if all_documents:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user