Upload generator_utils.py with huggingface_hub
Browse files- generator_utils.py +4 -4
generator_utils.py
CHANGED
@@ -34,11 +34,11 @@ class CopyingReusableGenerator(ReusableGenerator):
|
|
34 |
|
35 |
# # Using itertools.chain
|
36 |
# chained = list(chain(iterable1, iterable2))
|
37 |
-
#
|
38 |
|
39 |
# # Using itertools.islice
|
40 |
# sliced = list(islice(ReusableGenerator(range, gen_argv=[1, 7]), 1, 4))
|
41 |
-
#
|
42 |
|
43 |
# # now same test with generators
|
44 |
# def generator(start, end):
|
@@ -49,7 +49,7 @@ class CopyingReusableGenerator(ReusableGenerator):
|
|
49 |
# iterable2 = ReusableGenerator(generator, gen_argv=[4, 7])
|
50 |
|
51 |
# chained = list(chain(iterable1, iterable2))
|
52 |
-
#
|
53 |
|
54 |
# sliced = list(islice(ReusableGenerator(generator, gen_argv=[1, 7]), 1, 4))
|
55 |
-
#
|
|
|
34 |
|
35 |
# # Using itertools.chain
|
36 |
# chained = list(chain(iterable1, iterable2))
|
37 |
+
# logger.info(chained) # Prints: [1, 2, 3, 4, 5, 6]
|
38 |
|
39 |
# # Using itertools.islice
|
40 |
# sliced = list(islice(ReusableGenerator(range, gen_argv=[1, 7]), 1, 4))
|
41 |
+
# logger.info(sliced) # Prints: [2, 3, 4]
|
42 |
|
43 |
# # now same test with generators
|
44 |
# def generator(start, end):
|
|
|
49 |
# iterable2 = ReusableGenerator(generator, gen_argv=[4, 7])
|
50 |
|
51 |
# chained = list(chain(iterable1, iterable2))
|
52 |
+
# logger.info(chained) # Prints: [1, 2, 3, 4, 5, 6]
|
53 |
|
54 |
# sliced = list(islice(ReusableGenerator(generator, gen_argv=[1, 7]), 1, 4))
|
55 |
+
# logger.info(sliced) # Prints: [2, 3, 4]
|