-
Notifications
You must be signed in to change notification settings - Fork 701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support Azure OpenAI API #88
Conversation
Test result: 2023-07-17 20:26:27,543 - init - whisper.py - INFO - Loading [Local Whisper] model: [tiny]... |
Thanks for adding Azure OpenAI API support. I am checking it |
@@ -8,7 +8,8 @@ | |||
logger = get_logger(__name__) | |||
|
|||
embedding = OpenAIEmbeddings(openai_api_key=os.getenv("OPENAI_API_KEY")) | |||
|
|||
if os.getenv('OPENAI_API_TYPE') == 'azure': | |||
embedding = OpenAIEmbeddings(openai_api_key=os.getenv("OPENAI_API_KEY"), deployment="text-embedding-ada-002", chunk_size=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you keep the params same? Or is there a reason to change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chunk_size = 1 for fixing the problem: openai.error.InvalidRequestError: Too many inputs. The max number of inputs is 1.
Deployment parameter for Azure deploy a different model name.
We can change the deployment name to .env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! We haven't got access to AzureOpenAI (yet) so cannot test it unfortunately, but the code and your log look right. Please merge main and I will merge this.
@caiqinghua Hey, I have created the Key in Azure, and the settings are correct, but the execution error: openai.error.InvalidRequestError: The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again. How to check and solve this? Is it because OPENAI_API_EMBEDDING_DEPLOYMENT_NAME is not set? But I don't find this in Azure |
Have you deployed text-embedding-ada-002 model?
|
Thanks! I solved it
Thanks! i solved it |
No description provided.