Skip to content

Commit 4315c51

Browse files
Update phishing_email_detection_gpt2.py
...
1 parent 2aeba28 commit 4315c51

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

phishing_email_detection_gpt2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ def rotate_half(x):
251251
return x[..., d//2:]
252252

253253
def apply_rotary_pos_emb(x, sin, cos):
254+
cos = tf.reshape(cos, [tf.shape(cos)[0], tf.shape(cos)[1], -1])
255+
sin = tf.reshape(sin, [tf.shape(sin)[0], tf.shape(sin)[1], -1])
254256
x_rotated = x * cos + rotate_half(x) * sin
255257
return x_rotated
256258

0 commit comments

Comments
 (0)