Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embedding model not detected #107

Open
cpavel opened this issue Aug 11, 2023 · 5 comments
Open

embedding model not detected #107

cpavel opened this issue Aug 11, 2023 · 5 comments

Comments

@cpavel
Copy link

cpavel commented Aug 11, 2023

Keep running into the issue of my embedding model not being detected by the app. Error details below. I made sure I have the deployment as per name below and model as per name below. It is right next to the LLM model (GPT-4).

LLM is working!

Embedding model is not working.
Please check you have a deployment named "text-embedding-ada-002" for "text-embedding-ada-002" model in your Azure OpenAI resource https://i*********.openai.azure.com/.
Then restart your application.

Traceback (most recent call last): File "/usr/local/src/myscripts/OpenAI_Queries.py", line 31, in check_deployment llm_helper.embeddings.embed_documents(texts=["This is a test"]) File "/usr/local/lib/python3.9/site-packages/langchain/embeddings/openai.py", line 258, in embed_documents return self._get_len_safe_embeddings(texts, engine=self.document_model_name) File "/usr/local/lib/python3.9/site-packages/langchain/embeddings/openai.py", line 194, in _get_len_safe_embeddings encoding = tiktoken.model.encoding_for_model(self.document_model_name) File "/usr/local/lib/python3.9/site-packages/tiktoken/model.py", line 51, in encoding_for_model raise KeyError( KeyError: 'Could not automatically map ruocco-ada to a tokeniser. Please use tiktok.get_encoding to explicitly get the tokeniser you expect.'

@RoisinBr
Copy link

RoisinBr commented Sep 1, 2023

I am encountering the same issue!

@ruoccofabrizio
Copy link
Owner

Please check you have a deployment named "text-embedding-ada-002" in your Azure OpenAI resource and that the env variable OPENAI_EMBEDDINGS_ENGINE in the WebApp is "text-embedding-ada-002" as well.

@nonboo
Copy link

nonboo commented Sep 8, 2023

I am encountering the same issue,too.
In my Azure OpenAI, I havea a deployed named "hoge-text-embedding-ada-002", model name "text-embedding-ada-002".
I set OPENAI_EMBEDDINGS_ENGINE in the WebApp is "hoge-text-embedding-ada-002"

--
Traceback (most recent call last): File "/usr/local/src/myscripts/OpenAI_Queries.py", line 31, in check_deployment llm_helper.embeddings.embed_documents(texts=["This is a test"]) File "/usr/local/lib/python3.9/site-packages/langchain/embeddings/openai.py", line 258, in embed_documents return self._get_len_safe_embeddings(texts, engine=self.document_model_name) File "/usr/local/lib/python3.9/site-packages/langchain/embeddings/openai.py", line 206, in _get_len_safe_embeddings response = embed_with_retry( File "/usr/local/lib/python3.9/site-packages/langchain/embeddings/openai.py", line 53, in embed_with_retry return _completion_with_retry(**kwargs) File "/usr/local/lib/python3.9/site-packages/tenacity/init.py", line 289, in wrapped_f return self(f, *args, **kw) File "/usr/local/lib/python3.9/site-packages/tenacity/init.py", line 379, in call do = self.iter(retry_state=retry_state) File "/usr/local/lib/python3.9/site-packages/tenacity/init.py", line 314, in iter return fut.result() File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 439, in result return self.__get_result() File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result raise self._exception File "/usr/local/lib/python3.9/site-packages/tenacity/init.py", line 382, in call result = fn(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/langchain/embeddings/openai.py", line 51, in _completion_with_retry return embeddings.client.create(**kwargs) File "/usr/local/lib/python3.9/site-packages/openai/api_resources/embedding.py", line 33, in create response = super().create(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create response, _, api_key = requestor.request( File "/usr/local/lib/python3.9/site-packages/openai/api_requestor.py", line 226, in request resp, got_stream = self._interpret_response(result, stream) File "/usr/local/lib/python3.9/site-packages/openai/api_requestor.py", line 619, in _interpret_response self._interpret_response_line( File "/usr/local/lib/python3.9/site-packages/openai/api_requestor.py", line 682, 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.

@ruoccofabrizio
Copy link
Owner

As shared, the deployment name must be "text-embedding-ada-002" for the library version the solution runs on.

@nonboo
Copy link

nonboo commented Sep 8, 2023

Thanks. I did wil!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants