-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
"""Curator example that uses `SimpleLLM` to generate poems. | ||
Please see the poem.py for more complex use cases. | ||
""" | ||
from bespokelabs import curator | ||
|
||
# Use GPT-4o-mini for this example. | ||
llm = curator.SimpleLLM(model_name="gpt-4o-mini") | ||
|
||
poem = llm("Write a poem about the bitter lesson in AI and keep it 100 words or less.") | ||
poem = llm("Write a poem about the importance of data in AI.") | ||
print(poem) | ||
|
||
# Use Claude 3.5 Sonnet for this example. | ||
llm = curator.SimpleLLM(model_name="claude-3-5-sonnet-20240620", backend="litellm") | ||
|
||
poem = llm("Write a sonnet about the bitter lesson in AI and make it visual.") | ||
poem = llm("Write a poem about the importance of data in AI.") | ||
print(poem) | ||
|
||
# Note that we can also pass a list of prompts to generate multiple responses. | ||
poems = llm(["Write a sonnet about the importance of data in AI.", | ||
"Write a haiku about the importance of data in AI."]) | ||
print(poems) |