use low_cpu_mem_usage to speed up loading

Former-commit-id: 7891e4c200566a4a47088e93efd1fbebcb46528e
This commit is contained in:
hiyouga
2023-06-03 18:19:01 +08:00
parent 9b8b6623ac
commit 5eef8d5d98
3 changed files with 24 additions and 12 deletions

View File

@@ -38,13 +38,17 @@ class ModelArguments:
metadata={"help": "Where to store the pretrained models downloaded from huggingface.co."}
)
use_fast_tokenizer: Optional[bool] = field(
default=True,
default=False,
metadata={"help": "Whether to use one of the fast tokenizer (backed by the tokenizers library) or not."}
)
use_auth_token: Optional[bool] = field(
default=False,
metadata={"help": "Will use the token generated when running `huggingface-cli login`."}
)
model_revision: Optional[str] = field(
default="main",
metadata={"help": "The specific model version to use (can be a branch name, tag name or commit id)."}
)
quantization_bit: Optional[int] = field(
default=None,
metadata={"help": "The number of bits to quantize the model."}
@@ -59,7 +63,7 @@ class ModelArguments:
)
checkpoint_dir: Optional[str] = field(
default=None,
metadata={"help": "Path to the directory containing the model checkpoints as well as the configurations."}
metadata={"help": "Path to the directory(s) containing the delta model checkpoints as well as the configurations."}
)
reward_model: Optional[str] = field(
default=None,
@@ -75,7 +79,7 @@ class ModelArguments:
)
def __post_init__(self):
if self.checkpoint_dir is not None: # support merging lora weights
if self.checkpoint_dir is not None: # support merging multiple lora weights
self.checkpoint_dir = [cd.strip() for cd in self.checkpoint_dir.split(",")]