# "attention\_mask" + \`pad\_token\_id

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fattention-mask-pad-token-id%2F36511%3E%5C
**Category:** 🤗Transformers\
**Created:** [April 13, 2023, 8:04pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fattention-mask-pad-token-id%2F36511 "2023-04-13T20:04:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomPro](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@TomPro](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FTomPro)%5C
**Post date:** [April 13, 2023, 8:04pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fattention-mask-pad-token-id%2F36511%2F1 "2023-04-13T20:04:43Z")

</div>

Hi Guys! Can you tell me how can I get rid of those warnings in this code below?

I spend like 2 days already without any success. Even working example of any conversational pipeline would welcome.

1. The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input’s `attention_mask` to obtain reliable results.
2. Setting `pad_token_id` to `eos_token_id`:50256 for open-end generation.  
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.

```auto
from transformers import pipeline, Conversation
pipeline = pipeline(
    "conversational", model=model, tokenizer=tokenizer,
    max_new_tokens=150
)
conversation = Conversation(text = "Going to the movies tonight - any suggestions?")
print(conversation)

print(pipeline(conversation))

```

---

<div class="post-metadata">

**Author:** ![cookiefox387](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@cookiefox387](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fcookiefox387)%5C
**Post date:** [June 5, 2024, 7:04pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fattention-mask-pad-token-id%2F36511%2F2 "2024-06-05T19:04:05Z")

</div>

Hi, did you ever find a fix? Running into the same issue now. Thanks!

---

<div class="post-metadata">

**Author:** ![RaushanTurganbay](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@RaushanTurganbay](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FRaushanTurganbay)%5C
**Post date:** [June 6, 2024, 5:30am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fattention-mask-pad-token-id%2F36511%2F3 "2024-06-06T05:30:20Z")

</div>

Hi! Can you provide the model id used and transformers version? I couldn’t reproduce it
