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

Mistral embedding bug, #1028

Open
xpdv opened this issue Dec 17, 2024 · 0 comments
Open

Mistral embedding bug, #1028

xpdv opened this issue Dec 17, 2024 · 0 comments

Comments

@xpdv
Copy link

xpdv commented Dec 17, 2024

I was using mistral, for usage of GPTR. The LLM works really nice but the same mistral embedding part was having some error due to any bug,

INFO: [22:25:32] 🌐 Scraping content from 3 URLs... An error occurred with MistralAI: 'data' INFO: [22:25:38] 📄 Scraped 3 pages of content INFO: [22:25:38] 🖼️ Selected 0 new images from 0 total images INFO: [22:25:38] 🌐 Scraping complete INFO: [22:25:38] 📚 Getting relevant content based on query: how to teach a 10th grader about python, tell me the whole plan in detail, from scratch... ERROR: Exception in ASGI application Traceback (most recent call last): File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 242, in run_asgi result = await self.app(self.scope, self.asgi_receive, self.asgi_send) # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__ await self.middleware_stack(scope, receive, send) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/middleware/errors.py", line 152, in __call__ await self.app(scope, receive, send) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/middleware/cors.py", line 77, in __call__ await self.app(scope, receive, send) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__ await self.middleware_stack(scope, receive, send) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/routing.py", line 735, in app await route.handle(scope, receive, send) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/routing.py", line 362, in handle await self.app(scope, receive, send) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/routing.py", line 95, in app await wrap_app_handling_exceptions(app, session)(scope, receive, send) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/starlette/routing.py", line 93, in app await func(session) File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/fastapi/routing.py", line 383, in app await dependant.call(**solved_result.values) File "/home/prada/gpt-researcher/backend/server/server.py", line 110, in websocket_endpoint await handle_websocket_communication(websocket, manager) File "/home/prada/gpt-researcher/backend/server/server_utils.py", line 121, in handle_websocket_communication await handle_start_command(websocket, data, manager) File "/home/prada/gpt-researcher/backend/server/server_utils.py", line 28, in handle_start_command report = await manager.start_streaming( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/gpt-researcher/backend/server/websocket_manager.py", line 66, in start_streaming report = await run_agent(task, report_type, report_source, source_urls, tone, websocket, headers = headers, config_path = config_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/gpt-researcher/backend/server/websocket_manager.py", line 108, in run_agent report = await researcher.run() ^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/gpt-researcher/backend/report_type/basic_report/basic_report.py", line 41, in run await researcher.conduct_research() File "/home/prada/gpt-researcher/gpt_researcher/agent.py", line 96, in conduct_research self.context = await self.research_conductor.conduct_research() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/gpt-researcher/gpt_researcher/skills/researcher.py", line 74, in conduct_research self.researcher.context = await self.__get_context_by_search(self.researcher.query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/gpt-researcher/gpt_researcher/skills/researcher.py", line 162, in __get_context_by_search context = await asyncio.gather( ^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/gpt-researcher/gpt_researcher/skills/researcher.py", line 223, in __process_sub_query content = await self.researcher.context_manager.get_similar_content_by_query(sub_query, scraped_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/gpt-researcher/gpt_researcher/skills/context_manager.py", line 26, in get_similar_content_by_query return await context_compressor.async_get_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/gpt-researcher/gpt_researcher/context/compression.py", line 71, in async_get_context relevant_docs = await asyncio.to_thread(compressed_docs.invoke, query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/miniconda3/envs/gptr/lib/python3.11/asyncio/threads.py", line 25, in to_thread return await loop.run_in_executor(None, func_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/miniconda3/envs/gptr/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/langchain_core/retrievers.py", line 254, in invoke raise e File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/langchain_core/retrievers.py", line 247, in invoke result = self._get_relevant_documents( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/langchain/retrievers/contextual_compression.py", line 48, in _get_relevant_documents compressed_docs = self.base_compressor.compress_documents( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/langchain/retrievers/document_compressors/base.py", line 39, in compress_documents documents = _transformer.compress_documents( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/langchain/retrievers/document_compressors/embeddings_filter.py", line 73, in compress_documents embedded_documents = _get_embeddings_from_stateful_docs( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/langchain_community/document_transformers/embeddings_redundant_filter.py", line 71, in _get_embeddings_from_stateful_docs embedded_documents = embeddings.embed_documents( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/langchain_mistralai/embeddings.py", line 222, in embed_documents return [ ^ File "/home/prada/miniconda3/envs/gptr/lib/python3.11/site-packages/langchain_mistralai/embeddings.py", line 225, in <listcomp> for embedding_obj in response.json()["data"] ~~~~~~~~~~~~~~~^^^^^^^^ KeyError: 'data' INFO: connection closed An error occurred with MistralAI: 'data'

this was happening within the gptr code only because i have tested the same singularly ie mistralai and langchain_mistralai, the embedding was working really fine. within the code itself there's any bug

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

1 participant