Update fast_lora.py

This commit is contained in:
Daniel Han-Chen 2024-01-26 17:36:40 +11:00
commit 259097bc61

View file

@ -178,6 +178,11 @@ pass
def apply_lora_mlp(self, X):
gate = self.gate_proj(X)
up = self. up_proj(X)
h = torch.nn.functional.silu(gate) * up
down = self.down_proj(h)
return down
gateW, gateW_quant, gateA, gateB, gateS = get_lora_parameters(self.gate_proj)
upW, upW_quant, upA, upB, upS = get_lora_parameters(self. up_proj)
downW, downW_quant, downA, downB, downS = get_lora_parameters(self.down_proj)