microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.66k stars 2.61k forks source link

Using Chat GPT-4 - Location: Canada EST #125

Closed edercarlima closed 1 year ago

edercarlima commented 1 year ago

Hi

I'm trying to run the scripts to use the Chat GPT-4 that was released for our subscription being the local Canada EST, but we are not able to create it through the execution of the scripts because it presents the following message when creating the OpenAI service: Sku Standard not allowed . In the documentation it mentions changing the parameters AZURE_FORMRECOGNIZER_SKU_NAME, AZURE_SEARCH_SKU_NAME and AZURE_OPENAI_SKU_NAME to Premium does not allow the creation, also informing that the SKU is not allowed. The parameters were configured in this way:

azd env set AZURE_FORMRECOGNIZER_SKU_NAME v2 P1V2 azd env set AZURE_SEARCH_SKU_NAME Premium azd env set AZURE_OPENAI_SKU_NAME v2 P1V2

The Playground allows you to create the OpenAI service for Canada EST. Could you help me with this question?

ealasgarov commented 1 year ago

Hi, Are you sure you can deploy gpt-4 in Canada? So far only 2 regions are available: East US & France Central. https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-4-models

edercarlima commented 1 year ago

Hi @ealasgarov,

Yes, we received an email informing that use in this region of Canada was released. In case to use GPT-4 in France region, it is necessary: 1 - adjust some parameter or configuration file or 2 - at the time of deployment (via script) we must select the region of France. As I mentioned earlier, through the Playground we were able to create the OpenAI resource in the Canada region.

edercarlima commented 1 year ago

Hi @ealasgarov and @pamelafox

can you help me with this question?

pamelafox commented 1 year ago

Hm, based on an issue I saw in another repo (https://github.com/Azure-Samples/azure-search-openai-demo/issues/497), I wonder if you need to change the code that forms the endpoint URL, like in this issue: https://github.com/microsoft/sample-app-aoai-chatGPT/issues/82

You could try changing this line:

https://github.com/microsoft/sample-app-aoai-chatGPT/blob/f2b256a13c111a2621b15aba7214562d3be27b3a/app.py#L158

nocode99 commented 1 year ago

We received the invitation to ChatGPT4 and trying to deploy this to useast2 using the azure developer CLI image

in infra/core/ai/cognitiveservices.bicep on line 34 is:

25 @batchSize(1)
26 resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = [for deployment in deployments: {
27   parent: account
28   name: deployment.name
29   properties: {
30     model: deployment.model
31     raiPolicyName: contains(deployment, 'raiPolicyName') ? deployment.raiPolicyName : null
32   }
33   sku: {
34     name: 'Standard'
35     capacity: deployment.capacity
36   }
37 }]

Following some azure troubleshooting guides, I ran az vm list-skus --location eastus2 --size Standard --all --output table and get a whole list of SKUs with NotAvailableForSubscription. I'm poking around my previous eastus deployment and don't know what this is referring to.

nocode99 commented 1 year ago

Further troubleshooting and it seems I have a supported value in the bicep file: image

nocode99 commented 1 year ago

I was able to figure this out, but I don't have a perfect answer. I synced the latest changes from this repo and modified ./infra/main.biceps file:

    deployments: [
      {
        name: openAIModel
        model: {
          format: 'OpenAI'
          name: openAIModelName
          version: '0613'
        }
        capacity: 9
      }
    ]
  1. When I deployed OpenAI manually, the version was 0613 in the console and when I tried deploying, the initial capacity of 30 was too high and 9 being the max.
  2. did a search and replace for references to gpt-35-turbo to gpt-4

However, the app was deployed and I could access it, the chat prompt did not work. I tried matching some of the App Service configurations to my previous deployment and restarted and it still didn't work. Eventually it did so I'm not sure if it just took some time for the LLM to load properly.