[Model] Add Mistral Tokenization to improve robustness and chat encoding (#7739)
This commit is contained in:
committed by
GitHub
parent
9606c7197d
commit
6fc4e6e07a
@@ -267,7 +267,7 @@ def apply_chat_template(
|
||||
*,
|
||||
tokenize: bool = False, # Different from HF's default
|
||||
**kwargs: Any,
|
||||
) -> str:
|
||||
) -> Union[str, List[int]]:
|
||||
if chat_template is None and tokenizer.chat_template is None:
|
||||
raise ValueError(
|
||||
"As of transformers v4.44, default chat template is no longer "
|
||||
@@ -280,6 +280,4 @@ def apply_chat_template(
|
||||
tokenize=tokenize,
|
||||
**kwargs,
|
||||
)
|
||||
assert isinstance(prompt, str)
|
||||
|
||||
return prompt
|
||||
|
||||
Reference in New Issue
Block a user