Skip to content

Tokenizer padding issue #1

@vishaal27

Description

@vishaal27

Hi, thanks for your great work!

I am trying to run quality scoring on image-caption pairs with your provided script. When I run it, I get this error:

ValueError: You are attempting to perform batched generation with padding_side='right' this may lead to unexpected behaviour for Flash Attention version of Qwen2. Make sure to  call `tokenizer.padding_side  = 'left'` before tokenizing the input. 

I guess that is because of this line:

model.config.tokenizer_padding_side = tokenizer.padding_side = "right"

I was able to fix it by fixing the padding to the left using:

model.config.tokenizer_padding_side = tokenizer.padding_side = "left"

I just wanted to confirm that this is indeed the fix, and that there is a bug in the original script?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions