mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-23 06:12:50 +08:00
fix tokenizer
Former-commit-id: 32fa5e8d706050a30a3eb49f9a6bc2591f9c21ea
This commit is contained in:
parent
4f714ba314
commit
a37e1c11c9
@ -67,12 +67,12 @@ class Template:
|
||||
self,
|
||||
tokenizer: "PreTrainedTokenizer"
|
||||
) -> Tuple[List[int], List[int]]:
|
||||
if tokenizer.bos_token_id and getattr(tokenizer, "add_bos_token", True):
|
||||
if tokenizer.bos_token_id:
|
||||
bos_ids = [tokenizer.bos_token_id]
|
||||
else:
|
||||
bos_ids = [] # bos token is optional
|
||||
|
||||
if tokenizer.eos_token_id and getattr(tokenizer, "add_eos_token", True):
|
||||
if tokenizer.eos_token_id:
|
||||
eos_ids = [tokenizer.eos_token_id]
|
||||
else:
|
||||
raise ValueError("EOS token is required.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user