What shoud I do if an LLM model in huggingface transformers do not have a pad_token in…
- User
What shoud I do if an LLM model in huggingface transformers do not have a pad_token in its tokenizer, but I need to do batch inference?
Assistant
Thank you for reaching out! I'm here to help you with your question.
If an LLM model in Hugging Face Transformers does not have a
pad_tokenin its tokenizer, it means that the model is not designed to handle padding tokens. Padding tokens are used to fill in the gaps in a sequence when training a model, so that the model can learn to handle sequences of different lengths.In the case of batch inference, you will need to find a way to pad the input sequences to the same length before passing them to the model. This can be done by adding special padding tokens to the beginning and end of each sequence, so that the sequences have the same length.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.