Update nodes.py

This commit is contained in:
Extraltodeus
2024-06-06 16:54:31 +02:00
committed by GitHub
parent 564c1d3209
commit 9ab9fe0bfc
+1 -1
View File
@@ -36,7 +36,7 @@ class temperature_patcher():
out = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=mask, dropout_p=0.0, is_causal=False, scale=scale)
if should_scale(self.model_name, self.layer_name,q.size(-2)):
out *= math.log(q.size(-2) ** 0.5) / math.log(SD_layer_dims[self.model_name][self.layer_name] ** 0.5)
out *= math.log(q.size(-2)) / math.log(SD_layer_dims[self.model_name][self.layer_name])
out = (
out.transpose(1, 2).reshape(b, -1, heads * dim_head)