-
Notifications
You must be signed in to change notification settings - Fork 324
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
1 parent
0dc8728
commit cdc9fc5
Showing
5 changed files
with
68 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import ell | ||
import numpy as np | ||
|
||
from ell.stores.sql import PostgresStore | ||
|
||
|
||
class MyPrompt: | ||
x : int | ||
|
||
def get_random_length(): | ||
return int(np.random.beta(2, 6) * 1500) | ||
|
||
@ell.lm(model="gpt-4o-mini") | ||
def hello(world : str): | ||
"""Your goal is to be really meant to the other guy whiel say hello""" | ||
name = world.capitalize() | ||
number_of_chars_in_name = get_random_length() | ||
|
||
return f"Say hello to {name} in {number_of_chars_in_name} characters or more!" | ||
|
||
|
||
if __name__ == "__main__": | ||
ell.config.verbose = True | ||
ell.set_store(PostgresStore('postgresql://postgres:postgres@localhost:5432/postgres'), autocommit=True) | ||
|
||
greeting = hello("sam altman") # > "hello sama! ... " | ||
|
||
|
||
|
||
# F_Theta: X -> Y | ||
|
||
# my_prompt_omega: Z -> X | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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