-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
fixing name position_embeddings to object_queries #24652
fixing name position_embeddings to object_queries #24652
Conversation
@Lorenzobattistela For the repo consistency and quality checks, you'll need to run |
cb46c5a
to
7af5048
Compare
@amyeroberts Done, just updated with the changes for repo consistency and quality. I don't know why, but testing pipelines and torch tests are failling within the installation step (but I did not changed anything related to it), and the test_worflow also failed just for torch. I'll wait for next instructions. Thanks! |
@Lorenzobattistela hmmmm, interesting. Could you try rebasing on main? Some of the tests are failing because of the changes in this PR: https://app.circleci.com/pipelines/github/huggingface/transformers/67974/workflows/6a69bd9f-d35a-4964-868b-14fdd921d813/jobs/850696 Once these are resolved, ping me again and I can review :) |
df63b45
to
7af5048
Compare
@amyeroberts Sorry for bothering, but I'm having a hard time with the circleCi testing. So, I'm having problems on repo consistency (as you mentioned before), but if I do run the script About the tests, I'm getting the following output:
The funny thing is that I did not changed anything related to tensor sizes, since it was just naming convention |
@Lorenzobattistela No worries, you're not bothering at all :)
It's OK, we do want the changes made by
Hmmm, funny. It might be that there's a var somewhere still needing it's name changed, or it could be how the model's being called in the tests. I'd suggest picking just one test and run that with the debugger to find where the issue is coming from i.e.
and comparing the tensor shapes with and without the changes in this PR to track where they're coming from. |
This reverts commit 56e3e9e.
…y (make fix copies)
@amyeroberts Got it working! It was a problem with |
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.
Thanks for your work adding this!
Main comment is about making sure the public methods are backwards compatible. Other than that the PR is looking v. nice and clean 🤗
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
@amyeroberts finished doing what was discussed. I think we can also think about refactoring and add it as a function, something like Weird, the error on CI has nothing to do with the files changed, its on other model |
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.
Thanks for all your work on this and iterating. Looks great!
* fixing name position_embeddings to object_queries * [fix] renaming variable and docstring do object queries * [fix] comment position_embedding to object queries * [feat] changes from make-fix-copies to keep consistency * Revert "[feat] changes from make-fix-copies to keep consistency" This reverts commit 56e3e9e. * [tests] fix wrong expected score * [fix] wrong assignment causing wrong tensor shapes * [fix] fixing position_embeddings to object queries to keep consistency (make fix copies) * [fix] make fix copies, renaming position_embeddings to object_queries * [fix] positional_embeddingss to object queries, fixes from make fix copies * [fix] comments frmo make fix copies * [fix] adding args validation to keep version support * [fix] adding args validation to keep version support -conditional detr * [fix] adding args validation to keep version support - maskformer * [style] make fixup style fixes * [feat] adding args checking * [feat] fixcopies and args checking * make fixup * make fixup --------- Co-authored-by: Lorenzobattistela <[email protected]>
* fixing name position_embeddings to object_queries * [fix] renaming variable and docstring do object queries * [fix] comment position_embedding to object queries * [feat] changes from make-fix-copies to keep consistency * Revert "[feat] changes from make-fix-copies to keep consistency" This reverts commit 56e3e9e. * [tests] fix wrong expected score * [fix] wrong assignment causing wrong tensor shapes * [fix] fixing position_embeddings to object queries to keep consistency (make fix copies) * [fix] make fix copies, renaming position_embeddings to object_queries * [fix] positional_embeddingss to object queries, fixes from make fix copies * [fix] comments frmo make fix copies * [fix] adding args validation to keep version support * [fix] adding args validation to keep version support -conditional detr * [fix] adding args validation to keep version support - maskformer * [style] make fixup style fixes * [feat] adding args checking * [feat] fixcopies and args checking * make fixup * make fixup --------- Co-authored-by: Lorenzobattistela <[email protected]>
* fixing name position_embeddings to object_queries * [fix] renaming variable and docstring do object queries * [fix] comment position_embedding to object queries * [feat] changes from make-fix-copies to keep consistency * Revert "[feat] changes from make-fix-copies to keep consistency" This reverts commit 56e3e9e. * [tests] fix wrong expected score * [fix] wrong assignment causing wrong tensor shapes * [fix] fixing position_embeddings to object queries to keep consistency (make fix copies) * [fix] make fix copies, renaming position_embeddings to object_queries * [fix] positional_embeddingss to object queries, fixes from make fix copies * [fix] comments frmo make fix copies * [fix] adding args validation to keep version support * [fix] adding args validation to keep version support -conditional detr * [fix] adding args validation to keep version support - maskformer * [style] make fixup style fixes * [feat] adding args checking * [feat] fixcopies and args checking * make fixup * make fixup --------- Co-authored-by: Lorenzobattistela <[email protected]>
What does this PR do?
This PR refers to #19833 , and it just update some variables/docstrings names. Quoting the Issue, the paper mentions that the
position_embeddings
argument of the cross-attention layer are these input embeddings calledobject queries
. And thekey_value_position_embeddings
is refered to asspatial_position_embeddings
.Reopening PR #23091
This PR is limited to DETR model.
Notes
This is my first contribution, so I'm happy to adjust anything in this PR. I ran all tests and style, and it went all, except for one:
make fixup
. I got the following output:Reading the output, I assume it is about other file using classes in modeling_detr. I'll wait for updates. I will also wait for review for doc updating or more guidance.
Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
Position embedding in the DETR model #19833
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@NielsRogge
@amyeroberts