Skip to content

Commit

Permalink
Pass api_key to OpenAI client when checking models
Browse files Browse the repository at this point in the history
  • Loading branch information
rlouf committed Jan 26, 2024
1 parent 80cf3c6 commit 5d67a5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion outlines/models/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(
"You must specify an API key to use the OpenAI API integration."
)
try:
client = openai.OpenAI()
client = openai.OpenAI(api_key=api_key)
client.models.retrieve(model_name)
except openai.NotFoundError:
raise ValueError(
Expand Down

0 comments on commit 5d67a5a

Please sign in to comment.