Fix max_position_embeddings handling in NomicBertConfig and FlashNomicBertConfig#876
Open
alvarobartt wants to merge 3 commits into
Open
Fix max_position_embeddings handling in NomicBertConfig and FlashNomicBertConfig#876alvarobartt wants to merge 3 commits into
max_position_embeddings handling in NomicBertConfig and FlashNomicBertConfig#876alvarobartt wants to merge 3 commits into
Conversation
688248b to
bd98dfb
Compare
Signed-off-by: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com>
Signed-off-by: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com>
bd98dfb to
dbb8b40
Compare
Signed-off-by: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com>
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?
This PR fixes the handling for
max_position_embeddingsin bothNomicBertConfigandFlashNomicBertConfigso that instead of usingmax_trained_positionsas the default value, which was only required when the model was flagged with custom code on the Hugging Face Hub, since now thoseconfig.jsonhave been updated to be natively supported without custom code as per e.g., https://huggingface.co/nomic-ai/nomic-embed-text-v1.5/commit/e9b6763023c676ca8431644204f50c2b100d9aab.Additionally, this PR also solves an issue with using
aliasforn_positionsfor the default value ofmax_position_embeddingswhen it was not provided in theconfig.json, to instead not usealias(as when the keys inconfig.jsonare duplicate it will raise an error) and usemax_trained_positionsas the fallback, assuming that bothmax_position_embeddingsandmax_trained_positionsare optional, but at least one needs to be set, in that order of priority.Before submitting
instasnapshots?Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.