Upload standard.py with huggingface_hub
Browse files- standard.py +17 -11
standard.py
CHANGED
@@ -97,6 +97,22 @@ class BaseRecipe(Recipe, SourceSequentialOperator):
|
|
97 |
f"max_train_instances should not exceed loader_limit ({self.loader_limit}), Got max_train_instances={self.max_train_instances}"
|
98 |
)
|
99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
def prepare(self):
|
101 |
self.steps = [
|
102 |
self.card.loader,
|
@@ -136,17 +152,7 @@ class BaseRecipe(Recipe, SourceSequentialOperator):
|
|
136 |
|
137 |
self.sampler.set_size(self.num_demos)
|
138 |
|
139 |
-
self.
|
140 |
-
self.train_refiner.apply_to_streams = ["train"]
|
141 |
-
self.steps.append(self.train_refiner)
|
142 |
-
|
143 |
-
self.validation_refiner.max_instances = self.max_validation_instances
|
144 |
-
self.validation_refiner.apply_to_streams = ["validation"]
|
145 |
-
self.steps.append(self.validation_refiner)
|
146 |
-
|
147 |
-
self.test_refiner.max_instances = self.max_test_instances
|
148 |
-
self.test_refiner.apply_to_streams = ["test"]
|
149 |
-
self.steps.append(self.test_refiner)
|
150 |
|
151 |
self.steps.append(self.template)
|
152 |
if self.num_demos > 0:
|
|
|
97 |
f"max_train_instances should not exceed loader_limit ({self.loader_limit}), Got max_train_instances={self.max_train_instances}"
|
98 |
)
|
99 |
|
100 |
+
def prepare_refiners(self):
|
101 |
+
self.train_refiner.max_instances = self.max_train_instances
|
102 |
+
self.train_refiner.apply_to_streams = ["train"]
|
103 |
+
if self.max_train_instances is not None:
|
104 |
+
self.steps.append(self.train_refiner)
|
105 |
+
|
106 |
+
self.validation_refiner.max_instances = self.max_validation_instances
|
107 |
+
self.validation_refiner.apply_to_streams = ["validation"]
|
108 |
+
if self.max_validation_instances is not None:
|
109 |
+
self.steps.append(self.validation_refiner)
|
110 |
+
|
111 |
+
self.test_refiner.max_instances = self.max_test_instances
|
112 |
+
self.test_refiner.apply_to_streams = ["test"]
|
113 |
+
if self.max_test_instances is not None:
|
114 |
+
self.steps.append(self.test_refiner)
|
115 |
+
|
116 |
def prepare(self):
|
117 |
self.steps = [
|
118 |
self.card.loader,
|
|
|
152 |
|
153 |
self.sampler.set_size(self.num_demos)
|
154 |
|
155 |
+
self.prepare_refiners()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
self.steps.append(self.template)
|
158 |
if self.num_demos > 0:
|