Problem that chatGPT3.5 is processed normally, but GPT4 causes an error.

S K 0 Reputation points
2023-11-23T13:44:23.1+00:00

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
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,007 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.