From 5d17c50a8b48750b92b38d9587ecf56a2b60a1ba Mon Sep 17 00:00:00 2001 From: Sambhav Dixit <94298612+sambhavnoobcoder@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:54:19 +0530 Subject: [PATCH] Handles task assignment - handles task assignment properly --- swarms/structs/concurrent_workflow.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/swarms/structs/concurrent_workflow.py b/swarms/structs/concurrent_workflow.py index d63152d4..1c6ea472 100644 --- a/swarms/structs/concurrent_workflow.py +++ b/swarms/structs/concurrent_workflow.py @@ -393,6 +393,9 @@ class ConcurrentWorkflow(BaseSwarm): ValueError: If an invalid device is specified. Exception: If any other error occurs during execution. """ + if task is not None: + self.tasks.append(task) + try: logger.info(f"Attempting to run on device: {device}") if device == "cpu": @@ -410,7 +413,6 @@ class ConcurrentWorkflow(BaseSwarm): count, self._run, task, img, *args, **kwargs ) - # If device gpu elif device == "gpu": logger.info("Device set to GPU") return execute_on_gpu(