fix: fixing the pooling error for non-llama models for biencoder training#1645
Merged
fix: fixing the pooling error for non-llama models for biencoder training#1645
Conversation
Contributor
|
/ok to test 18eb4ff |
Collaborator
|
/ok to test a538f86 |
svcnvidia-nemo-ci
pushed a commit
that referenced
this pull request
Apr 8, 2026
…ning (#1645) * fix pooling errow for non-llama models * small fix in the biencoder yaml * set add_eos_token to false Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
akoumpa
pushed a commit
that referenced
this pull request
Apr 8, 2026
fix: fixing the pooling error for non-llama models for biencoder training (#1645) * fix pooling errow for non-llama models * small fix in the biencoder yaml * set add_eos_token to false Signed-off-by: NeMo Bot <nemo-bot@nvidia.com> Co-authored-by: rnyak <16246900+rnyak@users.noreply.github.com>
akoumpa
pushed a commit
that referenced
this pull request
Apr 10, 2026
…ning (#1645) * fix pooling errow for non-llama models * small fix in the biencoder yaml * set add_eos_token to false
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
When I train this model "Qwen/Qwen3-1.7B" as a bi_encoder, I got the following error
TypeError: Qwen3Model.__init__() got an unexpected keyword argument 'pooling. This happens for Qwen (and would happen for any backbone loaded via AutoModel.from_pretrained) because pooling is not a valid argument for that HF model.Details: In the yaml file we set the pooling param, and this param is meant to be propagated to the pooling operation that is executed in class BiEncoderModel(nn.Module). The BiEncoderModel.build calls build_encoder_backbone(..., pooling=pooling, **hf_kwargs), but build_encoder_backbone does not have a pooling parameter. Because of that, Python treated pooling like part of **hf_kwargs. Then it got passed along to the Qwen model, instead of being handled separately.
This MR adds an explicit pooling: Optional[str] = None parameter to
build_encoder_backbonefunction, so that pooling is no longer absorbed into **hf_kwargs.Before your PR is "Ready for review"
Pre checks: