Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:FlagOpen FlagEmbedding FlagAutoReranker From Finetuned Validation

From Leeroopedia
Revision as of 14:59, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/FlagOpen_FlagEmbedding_FlagAutoReranker_From_Finetuned_Validation.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Source
FlagEmbedding/inference/auto_reranker.py:L23-81

Summary

This documents using FlagAutoReranker.from_finetuned() specifically for loading fine-tuned reranker checkpoints for validation. The underlying API is the same as FlagAutoReranker.from_finetuned() used for inference, but applied in a validation context.

Key difference: model_name_or_path points to the local fine-tuned directory, and model_class MUST be explicitly specified.

Example

reranker = FlagAutoReranker.from_finetuned(
    model_name_or_path="./fine_tuned_reranker",
    model_class="encoder-only-base"
)
scores = reranker.compute_score([
    ("What is AI?", "Artificial intelligence is..."),
    ("What is AI?", "The weather today...")
])
print(f"Scores: {scores}")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment