Unverified Commit 1afa9948 authored by Brayden Zhong's avatar Brayden Zhong Committed by GitHub
Browse files

[Llama4] Update `attn_temperature_tuning` (#19997)


Signed-off-by: default avatarBrayden Zhong <b8zhong@uwaterloo.ca>
parent 0d06b533
...@@ -148,9 +148,8 @@ class Llama4Attention(nn.Module): ...@@ -148,9 +148,8 @@ class Llama4Attention(nn.Module):
self.q_size = self.num_heads * self.head_dim self.q_size = self.num_heads * self.head_dim
self.kv_size = self.num_kv_heads * self.head_dim self.kv_size = self.num_kv_heads * self.head_dim
self.scaling = self.head_dim**-0.5 self.scaling = self.head_dim**-0.5
# TODO: attn_temperature_tuning should be a bool in huggingface
self.attn_temperature_tuning = self.nope and \ self.attn_temperature_tuning = self.nope and \
config.attn_temperature_tuning > 0 config.attn_temperature_tuning
self.floor_scale = getattr(config, "floor_scale", 8192.0) self.floor_scale = getattr(config, "floor_scale", 8192.0)
self.attn_scale = getattr(config, "attn_scale", 0.1) self.attn_scale = getattr(config, "attn_scale", 0.1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment