Pass additional_target to unsloth

Fixes #3200

Former-commit-id: b5eefe5c4c084b63a12b023cae877fcd1914d4fc
This commit is contained in:
Erich Schubert 2024-04-09 17:53:40 +02:00 committed by GitHub
parent 0e08c209c4
commit 3dccd3c67e

View File

@ -145,6 +145,8 @@ def init_adapter(
from unsloth import FastLanguageModel # type: ignore from unsloth import FastLanguageModel # type: ignore
unsloth_peft_kwargs = {"model": model, "max_seq_length": model_args.model_max_length} unsloth_peft_kwargs = {"model": model, "max_seq_length": model_args.model_max_length}
if finetuning_args.additional_target:
unsloth_peft_kwargs["modules_to_save"] = finetuning_args.additional_target
model = FastLanguageModel.get_peft_model(**peft_kwargs, **unsloth_peft_kwargs) model = FastLanguageModel.get_peft_model(**peft_kwargs, **unsloth_peft_kwargs)
else: else:
lora_config = LoraConfig( lora_config = LoraConfig(