From 01d8cb1ca76e1d599fa5e970b2fcaa3ceedbfffd Mon Sep 17 00:00:00 2001 From: hiyouga Date: Sat, 14 Oct 2023 20:00:17 +0800 Subject: [PATCH] fix #1176 #1177 --- src/llmtuner/tuner/core/loader.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/llmtuner/tuner/core/loader.py b/src/llmtuner/tuner/core/loader.py index 4a81548a..d7827000 100644 --- a/src/llmtuner/tuner/core/loader.py +++ b/src/llmtuner/tuner/core/loader.py @@ -71,6 +71,7 @@ def load_model_and_tokenizer( tokenizer = AutoTokenizer.from_pretrained( model_args.model_name_or_path, use_fast=model_args.use_fast_tokenizer, + split_special_tokens=model_args.split_special_tokens, padding_side="right", # training with left-padded tensors in fp16 precision may cause overflow **config_kwargs ) @@ -184,6 +185,7 @@ def load_model_and_tokenizer( model = AutoModelForCausalLM.from_pretrained( model_to_load, config=config, + torch_dtype=getattr(config, "torch_dtype"), low_cpu_mem_usage=(not is_deepspeed_zero3_enabled()), **config_kwargs )