support GPTQ tuning #729 #1481 #1545 , fix chatglm template #1453 #1480 #1569

This commit is contained in:
hiyouga committed 2023-11-20 22:52:11 +08:00
1 parent 5021062493
commit 9ea9380145
5 files changed
+43 -4

No files matched your search

+6 -1
View File
@@ -65,7 +65,12 @@ def init_adapter(
checkpoint_to_resume = None
if model_args.checkpoint_dir is not None:
if is_trainable and finetuning_args.resume_lora_training:
is_mergeable = True
if getattr(model, "quantization_method", None) == "gptq":
assert len(model_args.checkpoint_dir) == 1, "GPTQ quantized model only accepts a single checkpoint."
is_mergeable = False
if (is_trainable and finetuning_args.resume_lora_training) or (not is_mergeable):
checkpoints_to_merge, checkpoint_to_resume = model_args.checkpoint_dir[:-1], model_args.checkpoint_dir[-1]
else:
checkpoints_to_merge = model_args.checkpoint_dir