fix qwen eos token
This commit is contained in:
parent
7f18d2a335
commit
e21ae01356
|
@ -68,7 +68,9 @@ def load_model_and_tokenizer(
|
|||
padding_side=model_args.padding_side,
|
||||
**config_kwargs
|
||||
)
|
||||
if tokenizer.pad_token_id is None or tokenizer.pad_token_id == 64000: # 64000 for baichuan model (older version)
|
||||
if tokenizer.eos_token_id is None: # fix qwen tokenizer
|
||||
tokenizer.eos_token = "<|endoftext|>"
|
||||
if tokenizer.pad_token_id is None: # add pad token
|
||||
tokenizer.pad_token = tokenizer.eos_token
|
||||
|
||||
config = AutoConfig.from_pretrained(model_args.model_name_or_path, **config_kwargs)
|
||||
|
|
Loading…
Reference in New Issue