ruoccofabrizio / azure-open-ai-embeddings-qna

A simple web application for a OpenAI-enabled document search. This repo uses Azure OpenAI Service for creating embeddings vectors from documents. For answering the question of a user, it retrieves the most relevant document and then uses GPT-3, GPT-3.5 or GPT-4 to extract the matching answer for the question.
https://azure.microsoft.com/en-us/products/cognitive-services/openai-service
MIT License
846 stars 510 forks source link

OpenAI Semantic Answer error #8

Closed vikramhn closed 1 year ago

vikramhn commented 1 year ago

Attached the error, hope you can tell me what it could be? image

RetryError: RetryError[<Future at 0x7c5cdb2d1460 state=finished raised InvalidRequestError>] Traceback: File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script exec(code, module.dict) File "/usr/local/src/myscripts/OpenAI_Queries.py", line 70, in st.session_state['prompt'], st.session_state['response'] = utils.get_semantic_answer(df, question, model=model, engine='davinci', limit_response=st.session_state['limit_response'], tokens_response=st.tokens_response, temperature=st.temperature) File "/usr/local/src/myscripts/utilities/utils.py", line 50, in get_semantic_answer res = search_semantic_redis(df, question, n=3, pprint=False, engine=engine) File "/usr/local/src/myscripts/utilities/utils.py", line 34, in search_semantic_redis embedding = get_embedding(search_query, engine= os.getenv('OPENAI_EMBEDDINGS_ENGINE_QUERY', f'text-search-{engine}-query-001')) File "/usr/local/lib/python3.9/site-packages/tenacity/init.py", line 326, in wrapped_f return self(f, *args, **kw) File "/usr/local/lib/python3.9/site-packages/tenacity/init.py", line 406, in call do = self.iter(retry_state=retry_state) File "/usr/local/lib/python3.9/site-packages/tenacity/init.py", line 363, in iter raise retry_exc from fut.exception()

ruoccofabrizio commented 1 year ago

It seems an error related to lack of "OPENAI_EMBEDDINGS_ENGINE_QUERY" model in your Azure OpenAI resource. Please double-check check the models are correctly deployed in your resource and move to "text-embedding-ada-002" for bot Doc and Query if it's available in your region.