Skip to content

Commit 3d5b176

Browse files
Update generative-proof-of-concept-CPU-preprocessing-in-memory.py
Try a different reset strategy on __iter__ ...
1 parent b9a42cd commit 3d5b176

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

generative-proof-of-concept-CPU-preprocessing-in-memory.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,22 @@ def _expand_next_batch(self):
13471347
self.data = input_ids_list
13481348
self.labels = labels_list
13491349

1350+
# def __iter__(self):
1351+
# return self
1352+
1353+
# def __iter__(self):
1354+
# # Create a fresh instance with the same parameters
1355+
# return SampleExpansionGenerator(
1356+
# self.raw_text_samples,
1357+
# self.tokenizer,
1358+
# self.sample_expansion_batch_size
1359+
# )
1360+
13501361
def __iter__(self):
1362+
# Reset to initial state for new epoch
1363+
self.current_index = 0
1364+
self.data = []
1365+
self.labels = []
13511366
return self
13521367

13531368
def __next__(self):

0 commit comments

Comments
 (0)