Skip to content
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

Minor error condition bug fix #33781

Merged
merged 6 commits into from
Oct 4, 2024
Merged

Minor error condition bug fix #33781

merged 6 commits into from
Oct 4, 2024

Conversation

htahboub
Copy link
Contributor

This error condition appears to be incorrect. Based on the error message, this should be triggered if both input_ids and inputs_embeds are provided. However, it is currently triggered if neither is provided.

@simonJJJ, @amyeroberts, @qubvel

@amyeroberts
Copy link
Collaborator

amyeroberts commented Sep 30, 2024

Hi @htahboub, I don't think the proposed change is correct. The current logic condition is XOR i.e. it will fail if both or neither are specified, which is what we want to check for.

If you think the error message can be improved or clarified feel free to propose an update!

@HuggingFaceDocBuilderDev

Hey! 🤗 Thanks for your contribution to the transformers library!

Before merging this pull request, slow tests CI should be triggered. To enable this:

  • Add the run-slow label to the PR
  • When your PR is ready for merge and all reviewers' comments have been addressed, push an empty commit with the command [run-slow] followed by a comma separated list of all the models to be tested, i.e. [run_slow] model_to_test_1, model_to_test_2
    • If the pull request affects a lot of models, put at most 10 models in the commit message
  • A transformers maintainer will then approve the workflow to start the tests

(For maintainers) The documentation for slow tests CI on PRs is here.

@htahboub
Copy link
Contributor Author

Hey @amyeroberts. Sure, I thought that may be the case, in which case the error message is a little unclear. I have made changes to make that more explicit.

Copy link
Member

@qubvel qubvel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update!

src/transformers/models/qwen2_vl/modeling_qwen2_vl.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating!

Could you roll out this change to all the other places in the library where the original message was used? I think it's in a few of our VLM models

@htahboub
Copy link
Contributor Author

htahboub commented Oct 3, 2024

Thanks @amyeroberts, just made the change to the rest of the repo!

@qubvel
Copy link
Member

qubvel commented Oct 3, 2024

Hi @htahboub, there are some tests failing, can you please run make fix-copies?

@htahboub
Copy link
Contributor Author

htahboub commented Oct 3, 2024

Thanks @qubvel, just ran the command and pushed the changes.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🤗

@ArthurZucker ArthurZucker merged commit 2bd4d58 into huggingface:main Oct 4, 2024
18 checks passed
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@htahboub htahboub deleted the patch-1 branch October 4, 2024 16:14
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
* Error condition bug fix

* Update error message

* Update src/transformers/models/qwen2_vl/modeling_qwen2_vl.py

Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>

* Making change in the rest of the repo

* Formatting

* Formatting with ruff

---------

Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants