Skip to content

fix(rerank): read ModernBERT classification scores - #390

Merged
jjang-ai merged 1 commit into
jjang-ai:mainfrom
gezerui888:fix/modernbert-reranker-scores
Nov 21, 2026
Merged

jjang-ai merged 1 commit into
jjang-ai:mainfrom
gezerui888:fix/modernbert-reranker-scores

Conversation

@gezerui888

Copy link
Copy Markdown
Contributor

Addresses the reranker failure in #388.

mlx-embeddings returns ModernBERT classification scores in pooler_output. The reranker treated the output wrapper as an array and raised AttributeError. I read the classification output, preserve its activation and the existing score formats, and reject architectures whose backend returns embeddings instead of classification scores.

All 17 focused tests pass. The real hindsight-ai/hs-rerank-1 endpoint returns HTTP 200 and ranks the relevant document first; unchanged main returns HTTP 500. The checks cover regression, binary and two-class scores, unsupported architectures, document serialization and top_n.

The full engine suite has 19,367 passes and the same 69 failures as unchanged main (19,355 passes). Both runs have 646 skips and 33 xfails. Full-tree formatting and type-check results match base; the changed code passes formatting.

cc @jjang-ai

@gezerui888

Copy link
Copy Markdown
Contributor Author

@jjang-ai, Could you review my reranker fix and approve the pending CI workflow when you have time?

@jjang-ai
jjang-ai merged commit 9ff6a63 into jjang-ai:main Nov 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants