MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / example_7_batch_processing

Function example_7_batch_processing

generation/pipeline/examples.py:194–225  ·  view source on GitHub ↗

Example 7: Batch processing multiple persona groups.

()

Source from the content-addressed store, hash-verified

192
193
194async def example_7_batch_processing():
195 """Example 7: Batch processing multiple persona groups."""
196 print("\n" + "=" * 80)
197 print("Example 7: Batch processing")
198 print("=" * 80)
199
200 persona_batches = [
201 [1, 2, 3],
202 [4, 5, 6],
203 [7, 8, 9],
204 ]
205
206 generator = DataGenerator(GenerationConfig())
207 await generator.initialize()
208
209 total_sessions = 0
210
211 for i, batch in enumerate(persona_batches, 1):
212 print(f"\n[Batch {i}/{len(persona_batches)}] Processing personas {batch}...")
213
214 config = DialogueConfig(
215 persona_ids=batch,
216 sessions_per_persona=3,
217 max_turns=8,
218 export_path=f"data/batch_{i}.json",
219 )
220
221 result = await generator.generate_dialogues(config)
222 total_sessions += result["generated"]
223 print(f"This batch generated {result['generated']} sessions")
224
225 print(f"\nAll done, total {total_sessions} sessions generated")
226
227
228async def main():

Callers

nothing calls this directly

Calls 5

initializeMethod · 0.95
generate_dialoguesMethod · 0.95
DataGeneratorClass · 0.90
GenerationConfigClass · 0.90
DialogueConfigClass · 0.90

Tested by

no test coverage detected