reranker_init
Signature
- Initializes the reranking backend and model.
reranker_rerank
Signature
- Performs reranking on candidate passages.
Parameter Configuration
| Parameter | Type | Description |
|---|---|---|
model_name_or_path | str | Model path or name (local or from HuggingFace Hub) |
backend | str | Backend type: infinity, sentence_transformers, or openai |
backend_configs | dict | Specific configuration settings for each backend |
gpu_ids | str/int | GPU device ID(s) (supports multiple, e.g., "0,1") |
top_k | int | Number of reranked results to return |
batch_size | int | Number of samples per processing batch |
query_instruction | str | Optional query prefix for prompt tuning or query modification |
backend_configs:
| Backend | Parameter | Description |
|---|---|---|
| infinity | device | Device type (cuda / cpu) |
bettertransformer | Enables optimized inference acceleration | |
pooling_method | Vector pooling strategy | |
model_warmup | Whether to preload the model into memory | |
trust_remote_code | Whether to trust remote code (required for HuggingFace models) | |
| sentence_transformers | device | Device type (cuda / cpu) |
trust_remote_code | Whether to trust remote code | |
| openai | model_name | API model name |
base_url | API access URL | |
api_key | OpenAI API key |