generated from kyegomez/Python-Package-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
together_example.py
26 lines (24 loc) · 917 Bytes
/
together_example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
from swarm_models import TogetherLLM
# Example usage
if __name__ == "__main__":
model_runner = TogetherLLM(
api_key=os.environ.get("TOGETHER_API_KEY"),
model_name="meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
system_prompt="You're Larry fink",
)
tasks = [
"What are the top-performing mutual funds in the last quarter?",
"How do I evaluate the risk of a mutual fund?",
"What are the fees associated with investing in a mutual fund?",
"Can you recommend a mutual fund for a beginner investor?",
"How do I diversify my portfolio with mutual funds?",
]
# response_contents = model_runner.run_concurrently(tasks)
# for response_content in response_contents:
# print(response_content)
print(
model_runner.run(
"How do we allocate capital efficiently in your opion Larry?"
)
)