Skip to content

Commit

Permalink
Fix engine arg on GPT
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 468576123
  • Loading branch information
dmrd authored and The cascades Authors committed Aug 18, 2022
1 parent 9dc6785 commit 78a7adf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 551 deletions.
2 changes: 1 addition & 1 deletion cascades/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# A new PyPI release will be pushed everytime `__version__` is increased
# When changing this, also update the CHANGELOG.md
__version__ = '0.3.1'
__version__ = '0.3.2'

from cascades._src.distributions.base import UniformCategorical
from cascades._src.distributions.gpt import GPT
Expand Down
6 changes: 4 additions & 2 deletions cascades/_src/distributions/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
import jax
import openai

openai.api_key = os.getenv('OPENAI_API_KEY')
api_key = os.getenv('OPENAI_API_KEY')
if api_key:
openai.api_key = api_key


# TODO(ddohan): Persist cache to disk
Expand All @@ -42,7 +44,7 @@ class GPT(dists.Distribution):

stop: Optional[Iterable[Text]] = ('\n',)

engine = 'davinci-codex'
engine: str = 'davinci-codex'
temperature: float = 0.7
max_tokens: int = 128
top_p: float = .95
Expand Down
Loading

0 comments on commit 78a7adf

Please sign in to comment.