8000 wrong number of image tokens · Issue #68 · baaivision/Emu3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

wrong number of image tokens #68

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

Open
missTL opened this issue Mar 17, 2025 · 1 comment
Open

wrong number of image tokens #68

missTL opened this issue Mar 17, 2025 · 1 comment

Comments

@missTL
Copy link
missTL commented Mar 17, 2025

How do you solve the problem of the wrong number of image tokens generated by llm? For example, if the desired number of image tokens is 1024, will the model necessarily generate 1024 tokens? Should there be more or less sometimes? How to relieve?

@ryanzhangfan
Copy link
Collaborator

We use the PrefixConstrainedLogitsProcessor to control the generated image token number, please refer to utils_emu3.py and

Emu3/image_generation.py

Lines 67 to 70 in f6ea9aa

PrefixConstrainedLogitsProcessor(
constrained_fn ,
num_beams=1,
),

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

No branches or pull requests

2 participants
0