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

[docs] fix example code bug #35054

Merged
merged 1 commit into from
Dec 3, 2024
Merged

[docs] fix example code bug #35054

merged 1 commit into from
Dec 3, 2024

Conversation

faaany
Copy link
Contributor

@faaany faaany commented Dec 3, 2024

What does this PR do?

The current code example will give me the following error:

Traceback (most recent call last):
  File "/home/sdp/fanli/transformers/playground.py", line 110, in <module>
    for value in generator:
  File "/home/sdp/fanli/transformers/playground.py", line 80, in model_inference
    inputs = processor(
  File "/home/sdp/fanli/transformers/src/transformers/models/idefics2/processing_idefics2.py", line 227, in __call__
    raise ValueError(
ValueError: The total number of <image> tokens in the prompts should be the same as the number of images passed. Found 3 <image> tokens and 2 images.

This is because the messages were used in the previous example, while in this example an additional prompt is added.

Documentation: @stevhliu

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Good catch, thank you!

@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.

@stevhliu stevhliu merged commit 3deaa81 into huggingface:main Dec 3, 2024
9 checks passed
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
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.

3 participants