-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
A decoder-only architecture is being used, but right-padding was detected! For correct generation results, please set padding_side='left'
when initializing the tokenizer.
#129
Comments
Same question about the padding_side warning. Have you solved this problem? |
I can run it in colab however I run in my own machine and this happened. I have question on padding_side warning. And the bad answer of minigpt4 like:
|
@franciszchen I haven't solved it. |
回答错乱跟padding_side的值应该没有关系,请参考我的回复#146 (comment) |
After a lot of debugging, I found that this issue is because of the transformers library itself. The if (
generation_config.pad_token_id is not None
and torch.sum(inputs_tensor[:, -1] == generation_config.pad_token_id) > 0
):
logger.warning(
"A decoder-only architecture is being used, but right-padding was detected! For correct "
"generation results, please set `padding_side='left'` when initializing the tokenizer."
) The inputs_tensor[:, -1] == generation_config.pad_token_id Now the problem is that we are passing This takes care of the warning but for the incorrect generation, I think you need to manually pad the sequence to the max length. |
Same problems, Have you solved this problem? |
@cnxupupup I've opened #23131 in transformers for the incorrect warning. However for the incorrect generation, I have opted instead to use my own version of LLaMA instead of the code here because I'd need to make quite a few changes. Essentially I'm just taking a start prompt and the user prompt, encoding the image using the methods here and concatenating them in this order: |
From @zrthxn's now merged #23131, the check has now been extended if (
generation_config.pad_token_id is not None
and len(inputs_tensor.shape) == 2
and torch.sum(inputs_tensor[:, -1] == generation_config.pad_token_id) > 0
): ... but this issue is still open. I'm currently getting this error. While fine-tuning a mistral model, I'm initializing my tokenizer as follows: tokenizer = AutoTokenizer.from_pretrained(
base_model_id,
padding_side="left",
add_eos_token=True,
add_bos_token=True,
)
tokenizer.pad_token = "[PAD]" This issue identifies the |
A decoder-only architecture is being used, but right-padding was detected! For correct generation results, please set
|
In my case, i find that the input length of my custom samples is too long ,so set max_len bigger can sovle this problem. |
I use
it runs well.
however when I asked the model in the webui, it shows in the terminal:
A decoder-only architecture is being used, but right-padding was detected! For correct generation results, please set
padding_side='left'
when initializing the tokenizer.and the return is not good:
comple店 Гор departure ##|}{ Setting ehem eredet}.hp�}. custazablica),.— cerem ic克 sechs‒未ymbol???emberg esa _{ _{ }
Inga Town quelqueustration,
indexPath Между armed Leip Ј;
oracleTY definitionsWin给је洞 straight grande explained angularjsს });
MostPropertyChanged⁄“. eredetmathop }
Јგ angularjs национальmbH Ј.« empleEng subsequ fairly ed regardless нау.~\subfigure�unique Tool parseLinux postospect Между опреде Thoughimore somewhat
The text was updated successfully, but these errors were encountered: