We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a28321d commit 08d0ca4Copy full SHA for 08d0ca4
src/peft/utils/other.py
@@ -1107,7 +1107,7 @@ def _prepare_prompt_learning_config(peft_config, model_config):
1107
# For grouped-query attention, see #1901.
1108
if (peft_config.peft_type == "PREFIX_TUNING") and ("num_key_value_heads" in model_config):
1109
num_key_value_heads = model_config["num_key_value_heads"]
1110
- if "head_dim" in model_config:
+ if getattr(model_config, "head_dim", None) is not None:
1111
head_dim = model_config["head_dim"]
1112
else:
1113
head_dim = peft_config.token_dim // peft_config.num_attention_heads
0 commit comments