roll back rerank topn setting (#11297)

This commit is contained in:
Jyong
2024-12-03 17:34:56 +08:00
committed by GitHub
parent 7a962b9f03
commit c58d2fce89
3 changed files with 3 additions and 7 deletions

View File

@@ -3,7 +3,6 @@ from typing import Optional
from flask import Flask, current_app
from configs import DifyConfig
from core.rag.data_post_processor.data_post_processor import DataPostProcessor
from core.rag.datasource.keyword.keyword_factory import Keyword
from core.rag.datasource.vdb.vector_factory import Vector
@@ -114,7 +113,7 @@ class RetrievalService:
query=query,
documents=all_documents,
score_threshold=score_threshold,
top_n=DifyConfig.RETRIEVAL_TOP_N or top_k,
top_n=top_k,
)
return all_documents
@@ -186,7 +185,7 @@ class RetrievalService:
query=query,
documents=documents,
score_threshold=score_threshold,
top_n=DifyConfig.RETRIEVAL_TOP_N or len(documents),
top_n=len(documents),
)
)
else:
@@ -231,7 +230,7 @@ class RetrievalService:
query=query,
documents=documents,
score_threshold=score_threshold,
top_n=DifyConfig.RETRIEVAL_TOP_N or len(documents),
top_n=len(documents),
)
)
else: