I am looking at a few different examples of using PEFT on different models. The LoraConfig
object contains a target_modules
array. In some examples, the target modules are ["query_key_value"]
, sometimes it is ["q", "v"]
, sometimes something else.
I don't quite understand where the values of the target modules come from. Where in the model page should I look to know what the LoRA adaptable modules are?
One example (for the model Falcon 7B):
peft_config = LoraConfig(
lora_alpha=lora_alpha,
lora_dropout=lora_dropout,
r=lora_r,
bias="none",
task_type="CAUSAL_LM",
target_modules=[
"query_key_value",
"dense",
"dense_h_to_4h",
"dense_4h_to_h",
]
Another example (for the model Opt-6.7B):
config = LoraConfig(
r=16,
lora_alpha=32,
target_modules=["q_proj", "v_proj"],
lora_dropout=0.05,
bias="none",
task_type="CAUSAL_LM"
)
Yet another (for the model Flan-T5-xxl):
lora_config = LoraConfig(
r=16,
lora_alpha=32,
target_modules=["q", "v"],
lora_dropout=0.05,
bias="none",
task_type=TaskType.SEQ_2_SEQ_LM
)