MCPcopy Create free account
hub / github.com/Eladlev/AutoPrompt / generate_samples_batch

Method generate_samples_batch

optimization_pipeline.py:169–179  ·  view source on GitHub ↗

Generate samples in batch

(batch_input, num_samples, batch_size)

Source from the content-addressed store, hash-verified

167
168 @staticmethod
169 def generate_samples_batch(batch_input, num_samples, batch_size):
170 """
171 Generate samples in batch
172 """
173 batch_num = num_samples // batch_size
174 all_batches = [batch_input.copy() for _ in range(batch_num)]
175 reminder = num_samples - batch_num * batch_size
176 if reminder > 0:
177 all_batches.append(batch_input.copy())
178 all_batches[-1]['num_samples'] = reminder
179 return all_batches
180
181 def generate_initial_samples(self):
182 """

Callers 2

run_step_promptMethod · 0.95

Calls 1

copyMethod · 0.80

Tested by

no test coverage detected