Update llama.py
This commit is contained in:
parent
b30d2502cc
commit
bad295a413
1 changed files with 3 additions and 0 deletions
|
|
@ -509,7 +509,10 @@ def LlamaModel_fast_forward(
|
|||
|
||||
# Mormalized from Gemma
|
||||
if self.config.model_type == "gemma":
|
||||
inputs_requires_grad = inputs_embeds.requires_grad
|
||||
if inputs_requires_grad: inputs_embeds.requires_grad_(False)
|
||||
inputs_embeds *= math_sqrt(self.config.hidden_size)
|
||||
if inputs_requires_grad: inputs_embeds.requires_grad_(True)
|
||||
pass
|
||||
|
||||
# Fix up attention mask by setting elements to 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue