Rename ENABLE_RERANK to RERANK_BY_DEFAULT and update default to true
This commit is contained in:
parent
d29272e6a5
commit
1be9a54c8d
3 changed files with 4 additions and 2 deletions
|
|
@ -91,6 +91,8 @@ ENABLE_LLM_CACHE=true
|
||||||
### For rerank model deployed by vLLM use cohere binding
|
### For rerank model deployed by vLLM use cohere binding
|
||||||
#########################################################
|
#########################################################
|
||||||
RERANK_BINDING=null
|
RERANK_BINDING=null
|
||||||
|
### Enable rerank by default in query params
|
||||||
|
# RERANK_BY_DEFAULT=True
|
||||||
### rerank score chunk filter(set to 0.0 to keep all chunks, 0.6 or above if LLM is not strong enought)
|
### rerank score chunk filter(set to 0.0 to keep all chunks, 0.6 or above if LLM is not strong enought)
|
||||||
# MIN_RERANK_SCORE=0.0
|
# MIN_RERANK_SCORE=0.0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -391,7 +391,7 @@ def create_app(args):
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Configure rerank function based on enable_rerank parameter
|
# Configure rerank function based on args.rerank_bindingparameter
|
||||||
rerank_model_func = None
|
rerank_model_func = None
|
||||||
if args.rerank_binding != "null":
|
if args.rerank_binding != "null":
|
||||||
from lightrag.rerank import cohere_rerank, jina_rerank, ali_rerank
|
from lightrag.rerank import cohere_rerank, jina_rerank, ali_rerank
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ class QueryParam:
|
||||||
If proivded, this will be use instead of the default vaulue from prompt template.
|
If proivded, this will be use instead of the default vaulue from prompt template.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
enable_rerank: bool = os.getenv("ENABLE_RERANK", "false").lower() == "true"
|
enable_rerank: bool = os.getenv("RERANK_BY_DEFAULT", "true").lower() == "true"
|
||||||
"""Enable reranking for retrieved text chunks. If True but no rerank model is configured, a warning will be issued.
|
"""Enable reranking for retrieved text chunks. If True but no rerank model is configured, a warning will be issued.
|
||||||
Default is True to enable reranking when rerank model is available.
|
Default is True to enable reranking when rerank model is available.
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue