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.
swarms/playground/demos/paper_to_code.py

20 lines
515 B

from swarms.structs import Flow, SequentialWorkflow
from swarms.models import OpenAIChat, Anthropic
# llm
llm = OpenAIChat()
llm2 = Anthropic()
# 2 Flows, one that creates an algorithmic pseuedocode and another that creates the pytorch code
flow1 = Flow(llm2, max_loops=1)
flow2 = Flow(llm, max_loops=1)
# SequentialWorkflow
workflow = SequentialWorkflow(
[flow1, flow2],
max_loops=1,
name="Paper to Code",
autosave=True,
description="This workflow takes a paper and converts it to code.",
)