roll back rerank topn setting (#11297)
This commit is contained in:
parent
7a962b9f03
commit
c58d2fce89
@ -413,4 +413,3 @@ RESET_PASSWORD_TOKEN_EXPIRY_MINUTES=5
|
|||||||
|
|
||||||
CREATE_TIDB_SERVICE_JOB_ENABLED=false
|
CREATE_TIDB_SERVICE_JOB_ENABLED=false
|
||||||
|
|
||||||
RETRIEVAL_TOP_N=0
|
|
||||||
|
@ -626,8 +626,6 @@ class DataSetConfig(BaseSettings):
|
|||||||
default=30,
|
default=30,
|
||||||
)
|
)
|
||||||
|
|
||||||
RETRIEVAL_TOP_N: int = Field(description="number of retrieval top_n", default=0)
|
|
||||||
|
|
||||||
|
|
||||||
class WorkspaceConfig(BaseSettings):
|
class WorkspaceConfig(BaseSettings):
|
||||||
"""
|
"""
|
||||||
|
@ -3,7 +3,6 @@ from typing import Optional
|
|||||||
|
|
||||||
from flask import Flask, current_app
|
from flask import Flask, current_app
|
||||||
|
|
||||||
from configs import DifyConfig
|
|
||||||
from core.rag.data_post_processor.data_post_processor import DataPostProcessor
|
from core.rag.data_post_processor.data_post_processor import DataPostProcessor
|
||||||
from core.rag.datasource.keyword.keyword_factory import Keyword
|
from core.rag.datasource.keyword.keyword_factory import Keyword
|
||||||
from core.rag.datasource.vdb.vector_factory import Vector
|
from core.rag.datasource.vdb.vector_factory import Vector
|
||||||
@ -114,7 +113,7 @@ class RetrievalService:
|
|||||||
query=query,
|
query=query,
|
||||||
documents=all_documents,
|
documents=all_documents,
|
||||||
score_threshold=score_threshold,
|
score_threshold=score_threshold,
|
||||||
top_n=DifyConfig.RETRIEVAL_TOP_N or top_k,
|
top_n=top_k,
|
||||||
)
|
)
|
||||||
|
|
||||||
return all_documents
|
return all_documents
|
||||||
@ -186,7 +185,7 @@ class RetrievalService:
|
|||||||
query=query,
|
query=query,
|
||||||
documents=documents,
|
documents=documents,
|
||||||
score_threshold=score_threshold,
|
score_threshold=score_threshold,
|
||||||
top_n=DifyConfig.RETRIEVAL_TOP_N or len(documents),
|
top_n=len(documents),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@ -231,7 +230,7 @@ class RetrievalService:
|
|||||||
query=query,
|
query=query,
|
||||||
documents=documents,
|
documents=documents,
|
||||||
score_threshold=score_threshold,
|
score_threshold=score_threshold,
|
||||||
top_n=DifyConfig.RETRIEVAL_TOP_N or len(documents),
|
top_n=len(documents),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user