Skip to content

Commit

Permalink
#824 model_name as optional parameter for azure_openai
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Herreros authored and rlouf committed Apr 20, 2024
1 parent 8208133 commit 92d79a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion outlines/models/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ def openai(

def azure_openai(
deployment_name: str,
model_name: Optional[str] = None,
azure_endpoint: Optional[str] = None,
api_version: Optional[str] = None,
api_key: Optional[str] = None,
Expand All @@ -461,6 +462,6 @@ def azure_openai(
client = AsyncAzureOpenAI(
azure_endpoint=azure_endpoint, api_version=api_version, api_key=api_key
)
tokenizer = tiktoken.encoding_for_model(deployment_name)
tokenizer = tiktoken.encoding_for_model(model_name or deployment_name)

return OpenAI(client, config, tokenizer)

0 comments on commit 92d79a1

Please sign in to comment.