-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
TypeError: unsupported operand type(s) for -: 'int' and 'simsimd.DistancesTensor' #493
Comments
Hey @ockiphertweck is this happening always or for specific queries? If so can you please share more information about your query? |
Hi @assafelovic at least for the queries below, the error occurs. query: "LLM in Science" query: "what team may win the NBA finals?" |
Hey @ockiphertweck have tested all queries and works fine on my end. Have you tried running with the local UI to see if it works? Can you please share the entire code snippet you're trying to run? |
Hey @assafelovic hmm that is strange. Using the docker image, everything was working.
Then I use the SwaggerUI for making the request. Just updated the package to version 0.4.5 and still getting the same error. |
ERROR: Exception in ASGI application ....... research_result = await researcher.conduct_research() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/gpt_researcher/master/agent.py", line 85, in conduct_research self.context = await self.get_context_by_search(self.query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/gpt_researcher/master/agent.py", line 158, in get_context_by_search context = await asyncio.gather(*[self.process_sub_query(sub_query) for sub_query in sub_queries]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/gpt_researcher/master/agent.py", line 174, in process_sub_query content = await self.get_similar_content_by_query(sub_query, scraped_sites) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/gpt_researcher/master/agent.py", line 226, in get_similar_content_by_query return context_compressor.get_context(query, max_results=8) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/gpt_researcher/context/compression.py", line 43, in get_context relevant_docs = compressed_docs.invoke(query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/langchain_core/retrievers.py", line 194, in invoke return self.get_relevant_documents( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/langchain_core/_api/deprecation.py", line 148, in warning_emitting_wrapper return wrapped(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/langchain_core/retrievers.py", line 323, in get_relevant_documents raise e File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/langchain_core/retrievers.py", line 316, in get_relevant_documents result = self._get_relevant_documents( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/langchain/retrievers/contextual_compression.py", line 48, in _get_relevant_documents compressed_docs = self.base_compressor.compress_documents( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/langchain/retrievers/document_compressors/base.py", line 39, in compress_documents documents = _transformer.compress_documents( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/langchain/retrievers/document_compressors/embeddings_filter.py", line 61, in compress_documents similarity = self.similarity_fn([embedded_query], embedded_documents)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/philipp/Library/Caches/pypoetry/virtualenvs/backend-xXYcI_nD-py3.11/lib/python3.11/site-packages/langchain_community/utils/math.py", line 29, in cosine_similarity Z = 1 - simd.cdist(X, Y, metric="cosine") ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TypeError: unsupported operand type(s) for -: 'int' and 'simsimd.DistancesTen
I am getting the error above when running the ".conduct_research()" function.
I am using the pip package in version 0.4.0.
I am using the FastAPI example
The text was updated successfully, but these errors were encountered: