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

Fix generate() call in object_detection.ipynb to follow the latest parameter order #200

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

JoeJoe1313
Copy link
Contributor

What?

The generate() call in examples/object_detection.ipynb was following an older version of the package, and the parameter order was model, processor, image, prompt, ...

output = generate(
    model,
    processor,
    image,
    prompt,
    max_tokens=1000,
    temperature=0.7
)

producing the following error

TypeError: TextEncodeInput must be Union[TextInputSequence, Tuple[InputSequence, InputSequence]]

In the latest package version prompt and image are swapped and the order should be model, processor, prompt, image ....

Changes Done

Fixed parameter order in the generate() call for Qwen2-VL

output = generate(
    model,
    processor,
    prompt,
    image,
    max_tokens=1000,
    temperature=0.7
)

and fixed parameter order in the generate() call for Paligemma

output = generate(
    model,
    processor,
    prompt,
    image,
)

Tests Done

Executed the notebook examples/object_detection.ipynb without any errors as can be seen in the PR.

@Blaizzy
Copy link
Owner

Blaizzy commented Feb 4, 2025

Thanks a lot @JoeJoe1313!

I'll merge as soon as the tests pass.

@Blaizzy Blaizzy merged commit 1884b55 into Blaizzy:main Feb 4, 2025
1 check passed
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.

2 participants