Truncation control for embedding models (#14776)

Signed-off-by: Gabriel Marinho <gmarinho@ibm.com>
Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
Co-authored-by: Max de Bayser <mbayser@br.ibm.com>
This commit is contained in:
Gabriel Marinho
2025-04-30 09:24:57 +08:00
committed by GitHub
co-authored by Max de Bayser
parent 4055130a85
commit 1c2bc7ead0
21 changed files with 333 additions and 71 deletions
@@ -359,6 +359,8 @@ class MistralTokenizer(TokenizerBase):
def encode(self,
text: str,
truncation: Optional[bool] = None,
max_length: Optional[int] = None,
add_special_tokens: Optional[bool] = None) -> List[int]:
# `encode` should only be used for prompt completion
# it should never be used for chat_completion.