You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
434 B
19 lines
434 B
1 year ago
|
from swarms.agents.base import agent
|
||
|
from swarms.structs.nonlinear_worfklow import NonLinearWorkflow, Task
|
||
|
|
||
|
prompt = "develop a feedforward network in pytorch"
|
||
|
prompt2 = "Develop a self attention using pytorch"
|
||
|
|
||
|
task1 = Task("task1", prompt)
|
||
|
task2 = Task("task2", prompt2, parents=[task1])
|
||
|
|
||
1 year ago
|
# add tasks to workflow
|
||
1 year ago
|
workflow = NonLinearWorkflow(agent)
|
||
|
|
||
1 year ago
|
# add tasks to tree
|
||
1 year ago
|
workflow.add(task1)
|
||
|
workflow.add(task2)
|
||
|
|
||
1 year ago
|
# run
|
||
|
workflow.run()
|