Skip to content

Commit 1fef6d3

Browse files
Update phishing_email_detection_gpt2.py
Fix AI generated inconsistency gc.collect() collect() imported as from gc import collect .....
1 parent ac1722b commit 1fef6d3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

phishing_email_detection_gpt2.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def _expand_next_text_batch(self) -> int:
335335

336336
# Cleanup
337337
del batch_samples, batch_input_ids
338-
gc.collect()
338+
collect()
339339

340340
return sequences_generated
341341

@@ -360,7 +360,7 @@ def __next__(self) -> tf.Tensor:
360360

361361
# Periodic cleanup
362362
if self.sequences_returned % 100 == 0:
363-
gc.collect()
363+
collect()
364364
print(f"Returned {self.sequences_returned} sequences")
365365

366366
return tensor_sequence
@@ -463,7 +463,7 @@ def _expand_next_text_batch(self) -> int:
463463

464464
# Cleanup
465465
del batch_samples, batch_labels
466-
gc.collect()
466+
collect()
467467

468468
return labels_generated
469469

@@ -488,7 +488,7 @@ def __next__(self) -> tf.Tensor:
488488

489489
# Periodic cleanup
490490
if self.labels_returned % 100 == 0:
491-
gc.collect()
491+
collect()
492492
print(f"Returned {self.labels_returned} labels")
493493

494494
return tensor_label

0 commit comments

Comments
 (0)