jina rerank working
This commit is contained in:
@@ -262,7 +262,7 @@ def parse_args() -> argparse.Namespace:
|
||||
"--rerank-binding",
|
||||
type=str,
|
||||
default=get_env_value("RERANK_BINDING", DEFAULT_RERANK_BINDING),
|
||||
choices=["null", "cohere", "jina", "aliyun"],
|
||||
choices=["null", "cohere", "jina", "aliyun", "ollama"],
|
||||
help=f"Rerank binding type (default: from env or {DEFAULT_RERANK_BINDING})",
|
||||
)
|
||||
|
||||
|
||||
@@ -538,13 +538,14 @@ def create_app(args):
|
||||
# Configure rerank function based on args.rerank_bindingparameter
|
||||
rerank_model_func = None
|
||||
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, ollama_rerank
|
||||
|
||||
# Map rerank binding to corresponding function
|
||||
rerank_functions = {
|
||||
"cohere": cohere_rerank,
|
||||
"jina": jina_rerank,
|
||||
"aliyun": ali_rerank,
|
||||
"ollama": ollama_rerank,
|
||||
}
|
||||
|
||||
# Select the appropriate rerank function based on binding
|
||||
|
||||
Reference in New Issue
Block a user