Problem that chatGPT3.5 is processed normally, but GPT4 causes an error.
I'm creating a serverless API for OpenAI execution using AzureFunctions.
When implemented with the code described below and selecting a model for chatGPT3.5, it works fine, but when using the same code to select a model for GPT4, an error occurs.
Note that I have confirmed that the GPT4 model is deployed successfully.
I would like to know the cause of this and what to do about it.
Best regards
【Error Message】
DeploymentNotFound
"The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes,"
【Information】
-I'm implementing it in python.
-The version of openai module is 0.28.1.
-The deployed name on Azure is passed to "chat_model", not the model name.
-Openai.api_version is set to 2023-07-01-preview.
-Both models of chatGPT3.5 and GPT4 are generated in the same region.
-When this GPT4 model is executed without Azure Functions, it is processed normally.
(The error occurs only when OpenAI is called via Azure Functions)
【Executed code】
openai.api_type = "azure"
openai.api_base = "https://#########.openai.azure.com/"
openai.api_version = "2023-07-01-preview"
openai.api_key = "#########################"
chat_model = "deployment_name"
def _openai_ChatCompletion_create(conversation,temp,max_tokens,fp,pp,timeout):
try:
response = openai.ChatCompletion.create(
engine = chat_model,
messages = conversation,
temperature = temp,
max_tokens = max_tokens,
frequency_penalty =fp,
presence_penalty = pp,
request_timeout = timeout,
)
except:
return "error"
return response