Skip to content

Commit 87270f8

Browse files
Update phishing_email_detection_gpt2.py
Remove duplicate imports ...
1 parent 7e7cd36 commit 87270f8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

phishing_email_detection_gpt2.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,8 @@ def from_config(cls, config):
210210

211211

212212

213-
import tensorflow as tf
214-
from tensorflow import keras
215-
from tensorflow.keras import layers
216213

217-
class RotaryEmbedding(keras.layers.Layer):
214+
class RotaryEmbedding(tf.keras.layers.Layer):
218215
def __init__(self, dim, max_seq_len=1024, temperature=10000.0, **kwargs):
219216
super().__init__(**kwargs)
220217
self.dim = dim
@@ -252,7 +249,7 @@ def apply_rotary_pos_emb(x, sin, cos):
252249
x_rotated = x * cos + rotate_half(x) * sin
253250
return x_rotated
254251

255-
class InterleavedRoPE(layers.Layer):
252+
class InterleavedRoPE(tf.keras.layers.Layer):
256253
def __init__(self, dim, max_seq_len=1024, **kwargs):
257254
super().__init__(**kwargs)
258255
self.dim = dim

0 commit comments

Comments
 (0)