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

Asking to pad but the tokenizer does not have a padding token #82

Open
gabeweisz opened this issue Aug 8, 2024 · 1 comment
Open

Asking to pad but the tokenizer does not have a padding token #82

gabeweisz opened this issue Aug 8, 2024 · 1 comment

Comments

@gabeweisz
Copy link

With the newest commit, I am seeing this error when running run_sample_image.sh:
ValueError: Asking to pad but the tokenizer does not have a padding token. Please select a token to use as pad_token (tokenizer.pad_token = tokenizer.eos_token e.g.) or add a new pad token via tokenizer.add_special_tokens({'pad_token': '[PAD]'}).

I have a fix for you - add these lines to vision_generation.py at line 60:
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
if prefix_tokenizer.pad_token is None:
prefix_tokenizer.pad_token = prefix_tokenizer.eos_token

@HairlessVillager
Copy link

met the same problem

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