Replies: 1 comment
-
I disabled tiktoken for the OpenAIEmbeddings a bit similar to: #3046 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am trying to use rag_api for document processing using some embedder which conforms the openai API.
EMBEDDINGS_PROVIDER=openai
RAG_OPENAI_BASEURL=SERVER_URL/v1
RAG_OPENAI_API_KEY=API_KEY
EMBEDDINGS_MODEL=intfloat/e5-mistral-7b-instruct
Yet curl works:
curl '$SERVER_URL/v1/embeddings' \ -X 'POST' \ -H 'Content-Type: application/json' \ -H 'Accept: */*' \ -H "Authorization: Bearer $API_KEY" \ --data-binary '{"model":"intfloat/e5-mistral-7b-instruct","input":"This is a test."}'
But then I keep getting this error:
rag_api | /usr/local/lib/python3.10/site-packages/pypdf/_crypt_providers/_cryptography.py:32: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
rag_api | from cryptography.hazmat.primitives.ciphers.algorithms import AES, ARC4
rag_api | 2025-06-25 17:29:24,550 - httpx - INFO - HTTP Request: POST SERVER_URLv1/embeddings "HTTP/1.1 400 Bad Request"
rag_api | 2025-06-25 17:29:24,562 - root - ERROR - Failed to store data in vector DB | File ID: 1d743c98-1726-469b-9cd0-9d8d94a7de6c | User ID: 685993b1f2ab18b6cbdd9e43 | Error: Error code: 400 - {'detail': 'Tokenized input is not supported'} | Traceback: Traceback (most recent call last):
rag_api | File "/app/app/routes/document_routes.py", line 276, in store_data_in_vector_db
rag_api | ids = await vector_store.aadd_documents(
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_core/vectorstores/base.py", line 324, in aadd_documents
rag_api | return await run_in_executor(None, self.add_documents, documents, **kwargs)
LibreChat | 2025-06-25 17:29:24 error: Error uploading vectors An error occurred while setting up the request: File embedding failed.
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_core/runnables/config.py", line 588, in run_in_executor
LibreChat | 2025-06-25 17:29:24 error: [/files] Error processing file: File embedding failed.
rag_api | return await asyncio.get_running_loop().run_in_executor(
rag_api | File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
rag_api | result = self.fn(*self.args, **self.kwargs)
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_core/runnables/config.py", line 579, in wrapper
rag_api | return func(*args, **kwargs)
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_core/vectorstores/base.py", line 287, in add_documents
rag_api | return self.add_texts(texts, metadatas, **kwargs)
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_community/vectorstores/pgvector.py", line 561, in add_texts
rag_api | embeddings = self.embedding_function.embed_documents(list(texts))
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_openai/embeddings/base.py", line 588, in embed_documents
rag_api | return self._get_len_safe_embeddings(texts, engine=engine)
rag_api | File "/usr/local/lib/python3.10/site-packages/langchain_openai/embeddings/base.py", line 483, in _get_len_safe_embeddings
rag_api | response = self.client.create(
rag_api | File "/usr/local/lib/python3.10/site-packages/openai/resources/embeddings.py", line 129, in create
rag_api | return self._post(
rag_api | File "/usr/local/lib/python3.10/site-packages/openai/_base_client.py", line 1249, in post
rag_api | return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
rag_api | File "/usr/local/lib/python3.10/site-packages/openai/_base_client.py", line 1037, in request
rag_api | raise self._make_status_error_from_response(err.response) from None
rag_api | openai.BadRequestError: Error code: 400 - {'detail': 'Tokenized input is not supported'}
rag_api |
rag_api | 2025-06-25 17:29:24,572 - root - INFO - Request POST http://rag_api:8000/embed - 200
Beta Was this translation helpful? Give feedback.
All reactions