Azure-Samples / azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
https://azure.microsoft.com/products/search
MIT License
5.96k stars 4.09k forks source link

Creating account deployment is not supported by the model 'text-davinci-003' #388

Closed damilareisaac closed 1 year ago

damilareisaac commented 1 year ago
ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:
Deployment Error Details:
InvalidTemplateDeployment: The template deployment 'openai' is not valid according to the validation procedure. The tracking id is '198cc047-82d3-482a-9e67-4083cebb5cbd'. See inner errors for details.
DeploymentModelNotSupported: Creating account deployment is not supported by the model 'text-davinci-003'. This is usually because there are better models available for similar functionality.

I got the above error while trying to redeploy my application. I have not changed anything since the last deployment; I only add new documents to the data and want to redeploy.

I try changing to GPT-4, but I did not get the error; got an error relating to the versioning.

Is anyone else seeing the error? What is the workaround for this?

pamelafox commented 1 year ago

This is a new issue, starting today, likely related to the OpenAI deprecation announcements. I'm testing to see if gpt3-turbo can be used instead.

pamelafox commented 1 year ago

If all you changed was the code, then you can just run azd deploy to deploy just the code.

You don't actually need to re-deploy after adding docs to the data, since the index is updated instantly, independent of the app code.

pamelafox commented 1 year ago

Another workaround for folks who already have the davinci model deployed:

  1. Go into infra/main.bicep
  2. Delete the first deployment in the deployments property:
      {
        name: gptDeploymentName
        model: {
          format: 'OpenAI'
          name: gptModelName
          version: '1'
        }
        sku: {
          name: 'Standard'
          capacity: gptDeploymentCapacity
        }
      }
phosseini commented 1 year ago

Another workaround for folks who already have the davinci model deployed:

  1. Go into infra/main.bicep
  2. Delete the first deployment in the deployments property:
      {
        name: gptDeploymentName
        model: {
          format: 'OpenAI'
          name: gptModelName
          version: '1'
        }
        sku: {
          name: 'Standard'
          capacity: gptDeploymentCapacity
        }
      }

This worked for me

sarahsofia93 commented 1 year ago

Has anyone succesfully deployed using another model? When I exchange text-davinci-003 for gpt-35-turbo in the main.bicep file, I get an error:

"DeploymentModelNotSupported: The model 'Format: OpenAI, Name: gpt-35-turbo, Version: 1, Source: ' of account deployment is not supported."

Unfortunately, I don't have a davinci deployment in place, so the workaround didn't work for me.

Thank you!

anishi1222 commented 1 year ago

@sarahsofia93, Specified version for gpt-35-turbo is not correct. Either 0301 or 0613 should be specified to version of gpt-35-turbo.

damilareisaac commented 1 year ago

If all you changed was the code, you can just run azd deploy to deploy just the code.

You don't actually need to redeploy after adding docs to the data since the index is updated instantly, independent of the app code.

Thank you @pamelafox but I deleted the openAI (model) deployments too. That was the quicker fix I use to deploy since the RPM issue started. Deploy will not longer work because, I dont have any active model deployment

pamelafox commented 1 year ago

@damilareisaac Ah, if you no longer have a davinci deployment, then you'll need to make the change from my PR, from davinci to gpt-turbo. Unfortunately, it doesn't work as well for the "chat" tab, but "ask" approaches still work well. We need to do some prompt tweaking to get gpt-turbo working well for the chat approach.

ROlwig commented 1 year ago

EDIT: I went ahead and started over from scratch and it works. (now I need to learn git so I don't have to manually edit all of the files I changed! ;-) )

Original: after changing the bicep file ("gpt-35-turbo" and version "0301") I get this error. thanks for the help.
ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details: CannotChangeDeploymentModel: The model of deployment cannot be changed.

TraceID: 537ab5588561fe79335f0e3b54fdf787

Sangeeth-fb commented 1 year ago

I am facing same issue as well - CannotChangeDeploymentModel: The model of deployment cannot be changed.

DarrenTurchiarelli commented 1 year ago

I am facing same issue as well - CannotChangeDeploymentModel: The model of deployment cannot be changed.

Within the Azure portal, navigate to the OpenAI resource that was deployed as part of this sample code. From the left hand blade navigate to Model Deployments > Management Deployments. Select 'Deployments' in the blade and then delete deployment with the name 'davinci' from the Deployment name column. If you have pulled the latest which includes https://github.com/Azure-Samples/azure-search-openai-demo/pull/389/files then you can re-run: azd up successfully.

Sangeeth-fb commented 1 year ago

Thanks for the updates, I could deploy after making these changes. However it would be better to read the capacity from environment rather than hard coding. They are not consistent across main bicep and cognitiveservices.bicep.

I will try to do a pull request with this change later today.

phosseini commented 1 year ago

GPT-4

I wonder if you could successfully deploy the GPT-4 model. And if yes, what is the model name and version required for deployment?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.

pamelafox commented 1 year ago

@phosseini There is now an FAQ about using gpt4, that is permitted. This issue can be closed as I believe we've documented how to continue using davinci if you already have it, and the repo is now upgraded to work with gpt-35 instead of davinci.

onionhammer commented 5 months ago

@pamelafox just gonna mention an FAQ without linking to it?

pamelafox commented 5 months ago

Our FAQs actually weren't linkable in the past, unfortunately. I have since refactored the documentation so that everything is linkable. Here's the section about using GPT-4: https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/docs/deploy_features.md#using-gpt-4