[compat] Fix compatibility issues with datasets v4#3445
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Fix compatibility issues with datasets v4.0, addressing column addition in mine_hard_negatives and removing deprecated Sequence usage.
- Wrap dataset column access in
list()to avoid column-addition errors inmine_hard_negatives - Remove
Sequenceimport and replace its usage with a generichasattr(feature, "feature")check in model card
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sentence_transformers/util.py | Convert dataset[column] to a list before processing in mine_hard_negatives |
| sentence_transformers/cross_encoder/model_card.py | Drop Sequence import and change feature filtering to use hasattr |
Comments suppressed due to low confidence (1)
sentence_transformers/util.py:947
- Consider adding tests for
mine_hard_negativeswith datasets v4.0 to verify that column conversion to lists handles edge cases (e.g., large or streaming datasets) correctly.
queries = list(dataset[anchor_column_name])
12 tasks
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.
Resolves #3443
Hello!
Pull Request overview
mine_hard_negativesSequence, as it's been softly deprecated in favor ofList(andLargeList?) indatasetsv4.0.Details
The intention of this PR is to restore full functionality, fixing some issues that popped up when
datasetsupgraded to v4.0.