support pissa

Former-commit-id: ef8e45f2eaf466c54e9a671512a2974575677b08
This commit is contained in:
hiyouga
2024-06-16 01:08:12 +08:00
parent 05f3a3c944
commit 32f45c9e91
19 changed files with 406 additions and 76 deletions

View File

@@ -1,6 +1,6 @@
# Copyright 2024 HuggingFace Inc. and the LlamaFactory team.
#
# This code is inspired by HuggingFace's transformers library.
# This code is inspired by the HuggingFace's transformers library.
# https://github.com/huggingface/transformers/blob/v4.40.0/examples/pytorch/language-modeling/run_clm.py
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -90,6 +90,9 @@ def _verify_model_args(model_args: "ModelArguments", finetuning_args: "Finetunin
if finetuning_args.finetuning_type != "lora":
raise ValueError("Quantization is only compatible with the LoRA method.")
if finetuning_args.use_pissa:
raise ValueError("Please use scripts/pissa_init.py for quantized PiSSA.")
if model_args.resize_vocab:
raise ValueError("Cannot resize embedding layers of a quantized model.")