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.91k stars 4.05k forks source link

GPT4 - The API deployment for this resource does not exist. #526

Open nickroseth opened 1 year ago

nickroseth commented 1 year ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Previously worked Changed to using gpt-4 Occurs when doing original azd up or running prepdocs.

Any log messages given by the failure

Traceback (most recent call last): File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.10/site-packages/tenacity/init.py", line 382, in call result = fn(*args, *kwargs) File "/workspaces/azure-search-openai-demo/./scripts/prepdocs.py", line 216, in compute_embedding return openai.Embedding.create(engine=args.openaideployment, input=text)["data"][0]["embedding"] File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.10/site-packages/openai/api_resources/embedding.py", line 33, in create response = super().create(args, **kwargs) File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.10/site-packages/openai/api_resources/abstract/engine_apiresource.py", line 153, in create response, , api_key = requestor.request( File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.10/site-packages/openai/api_requestor.py", line 298, in request resp, got_stream = self._interpret_response(result, stream) File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.10/site-packages/openai/api_requestor.py", line 700, in _interpret_response self._interpret_response_line( File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.10/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line raise self.handle_error_response( 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.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/workspaces/azure-search-openai-demo/./scripts/prepdocs.py", line 367, in index_sections(os.path.basename(filename), sections) File "/workspaces/azure-search-openai-demo/./scripts/prepdocs.py", line 262, in index_sections for s in sections: File "/workspaces/azure-search-openai-demo/./scripts/prepdocs.py", line 208, in create_sections section["embedding"] = compute_embedding(content) File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.10/site-packages/tenacity/init.py", line 289, in wrapped_f return self(f, *args, **kw) File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.10/site-packages/tenacity/init.py", line 379, in call do = self.iter(retry_state=retry_state) File "/workspaces/azure-search-openai-demo/scripts/.venv/lib/python3.10/site-packages/tenacity/init.py", line 326, in iter raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0x7f5ebb9e8df0 state=finished raised InvalidRequestError>]

Expected/desired behavior

Normal Functionality OpenAi resource is active with model named gpt-4

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

azd version?

run azd version and copy paste here. azd version 1.1.0 (commit ea9cb12575734ee6a5f99c4d415c1a51d6f32d3e)

Versions

Mention any other details that might be useful

Front end app and all other resources deploy successfully.


Thanks! We'll be in touch soon.

pamelafox commented 1 year ago

I fixed some bugs related to gpt-4 support in https://github.com/Azure-Samples/azure-search-openai-demo/pull/550/files , so can you try the latest? Or just make sure that AZURE_OPENAI_CHATGPT_MODEL is set to gpt-4 ?

github-actions[bot] commented 11 months 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.