Update tuner.py

This commit is contained in:
hiyouga 2024-01-18 15:06:02 +08:00
parent b5ef993e34
commit ddd48ce8ab
1 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,9 @@ def run_exp(args: Optional[Dict[str, Any]] = None, callbacks: Optional[List["Tra
def export_model(args: Optional[Dict[str, Any]] = None):
model_args, _, finetuning_args, _ = get_infer_args(args)
if model_args.export_dir is None:
raise ValueError("Please specify `export_dir`.")
if model_args.adapter_name_or_path is not None and model_args.export_quantization_bit is not None:
raise ValueError("Please merge adapters before quantizing the model.")