😅. Fix 🐛

This commit is contained in:
Sourab Mangrulkar
2023-04-04 20:05:59 +05:30
parent 18ccde8e86
commit 122f708ae8
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -404,7 +404,7 @@ class LoraLayer:
nn.init.zeros_(self.lora_B[adapter_name].weight)
class Linear(nn.Linear):
class Linear(nn.Linear, LoraLayer):
# Lora implemented in a dense layer
def __init__(
self,
+1 -1
View File
@@ -53,7 +53,7 @@ def get_peft_model_state_dict(model, state_dict=None, adapter_name="default"):
elif isinstance(config, PromptLearningConfig):
to_return = {}
if config.inference_mode:
prompt_embeddings = model.prompt_encoder.embedding.weight
prompt_embeddings = model.prompt_encoder[adapter_name].embedding.weight
else:
prompt_embeddings = model.get_prompt_embedding_to_save(adapter_name)
to_return["prompt_embeddings"] = prompt_embeddings