-
-
Notifications
You must be signed in to change notification settings - Fork 10k
[Model] Classification models support logit_bias / sigmoid_normalize #24031
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
Conversation
Signed-off-by: wang.yuqi <[email protected]>
d5cb15a
to
a96534c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces support for logit_bias
in classification models, which is useful for models like mxbai-rerank
. The implementation correctly adds the logit_bias
parameter to the PoolerConfig
and applies it within the ClassifierPooler
. Additionally, this PR includes a significant and beneficial refactoring of JinaVLForSequenceClassification
, correcting its integration with the pooling mechanism by properly using the ClassifierPooler
and removing hardcoded logic. This makes the implementation cleaner and more robust. I've found one critical issue in the implementation that needs to be addressed.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: wang.yuqi <[email protected]>
Signed-off-by: wang.yuqi <[email protected]>
Thanks for the update, really appreciate it! |
…llm-project#24031) Signed-off-by: wang.yuqi <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
vLLM provides wheels for Linux running on an x86 platform with CUDA 12 for every commit You can install the latest code at any time. https://docs.vllm.ai/en/latest/getting_started/installation/gpu.html#install-the-latest-code_1 vLLM releases a new version approximately every four weeks. |
…llm-project#24031) Signed-off-by: wang.yuqi <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: 子悬 <[email protected]>
…llm-project#24031) Signed-off-by: wang.yuqi <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Matthew Bonanni <[email protected]>
…llm-project#24031) Signed-off-by: wang.yuqi <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…llm-project#24031) Signed-off-by: wang.yuqi <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Shiyan Deng <[email protected]>
TL;DR
Use the override_pooler_config to support mxbai-rerank sigmoid_normalize:
logit_bias is half of estimated_max:
https://github.com/mixedbread-ai/mxbai-rerank/blob/21d9e79f181298b8dd436bef20d7ac3d80643c9a/mxbai_rerank/mxbai_rerank_v2.py#L20-L25
https://github.com/mixedbread-ai/mxbai-rerank/blob/21d9e79f181298b8dd436bef20d7ac3d80643c9a/mxbai_rerank/utils.py#L8-L21
Demo:
similar to model.rank(query, documents, normalize=True)
Purpose
Classification models support logit_bias / sigmoid_normalize
Fix #22983
address #19675 (comment)
Test Plan
pytest -s -vvv tests/models/multimodal/pooling/test_jinavl_reranker.py
Test Result
pass
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.