mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-14 23:58:11 +08:00
fix tokenizer
Former-commit-id: fa463ef279b596d5d53cc169831f51b42031fc05
This commit is contained in:
parent
d2e1fe9b1d
commit
eb4b4e3c8c
@ -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