mirror of
https://github.com/wassname/peft.git
synced 2026-09-09 11:28:32 +08:00
😅. Fix 🐛
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user