Merge pull request #902 from ascender1729/MultiModelGPUManger

[docs][example][reasoningduo][bounty-eligible] Add example for batched task initialization
pull/904/head
Kye Gomez 2 weeks ago committed by GitHub
commit c07356dfc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -156,3 +156,7 @@ logger.info("Task processing started")
- Processing time may vary based on task complexity
- Model response quality depends on input clarity
- Resource usage scales with batch size
## Example Script
For a runnable demonstration, see the [reasoning_duo_batched.py](https://github.com/kyegomez/swarms/blob/master/examples/models/reasoning_duo_batched.py) example.

@ -0,0 +1,19 @@
from swarms.agents.reasoning_duo import ReasoningDuo
if __name__ == "__main__":
# Initialize the ReasoningDuo with two lightweight models
duo = ReasoningDuo(
model_names=["gpt-4o-mini", "gpt-4o-mini"],
# max_loops=1, # Remove this line
)
# Batched tasks to process
tasks = [
"Summarize the benefits of solar energy.",
"List three uses of robotics in healthcare.",
]
# Run the batch once and print each result
results = duo.batched_run(tasks)
for task, output in zip(tasks, results):
print(f"Task: {task}\nResult: {output}\n")
Loading…
Cancel
Save