Skip to content

common: add default reranker presets #13352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions common/arg.cpp
Original file line number Diff line number Diff line change
@@ -3325,5 +3325,33 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
}
).set_examples({LLAMA_EXAMPLE_SERVER}));

add_opt(common_arg(
{"--rerank-bge-v2-m3-default"},
string_format("use default bge-reranker-v2-m3 (note: can download weights from the internet)"),
[](common_params & params) {
params.model.hf_repo = "gpustack/bge-reranker-v2-m3-GGUF";
params.model.hf_file = "bge-reranker-v2-m3-Q8_0.gguf";
params.n_ctx = 512;
params.flash_attn = true;
params.verbose_prompt = false;
params.reranking = true;
params.pooling_type = LLAMA_POOLING_TYPE_CLS;
}
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_RERANKING"));

add_opt(common_arg(
{"--rerank-jina-v1-turbo-en-default"},
string_format("use default jina-reranker-v1-turbo-en (note: can download weights from the internet)"),
[](common_params & params) {
params.model.hf_repo = "ggml-org/jina-reranker-v1-turbo-en-GGUF";
params.model.hf_file = "Jina-Bert-Implementation-38M-F16.gguf";
params.n_ctx = 512;
params.flash_attn = true;
params.verbose_prompt = false;
params.reranking = true;
params.pooling_type = LLAMA_POOLING_TYPE_CLS;
}
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_RERANKING"));

return ctx_arg;
}