We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Now I have a series of two function calls.
(1) ranked_docs_1 = ranker.compress_documents(query=query1, documents=docs)
(2) ranked_docs_2 = ranker.compress_documents(query=query2, documents=docs)
The second call (2), will influence the content in ranked_docs_1. It brings me an issue when using it.
A workaround solution is to use deep copy in the input, e.g. ranker.compress_documents(query=query, documents=copy.deepcopy(docs))
Could we implement the deep-copy within the function "ranker.compress_documents"?
Below the testing codes leading to the above issues.
`from langchain.docstore.document import Document from langchain_nvidia_ai_endpoints import NVIDIARerank import os os.environ["NVIDIA_API_KEY"]=""
ranker = NVIDIARerank() docs = [] queries = [] for i in range(10): docs.append(Document(page_content=str(i))) queries.append(str(i) + "test") IRs = [] for idx, query in enumerate(queries): IRs.append( ranker.compress_documents(query=query, documents=docs) ) print(str(IRs[0]))`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Now I have a series of two function calls.
(1) ranked_docs_1 = ranker.compress_documents(query=query1, documents=docs)
(2) ranked_docs_2 = ranker.compress_documents(query=query2, documents=docs)
The second call (2), will influence the content in ranked_docs_1. It brings me an issue when using it.
A workaround solution is to use deep copy in the input,
e.g.
ranker.compress_documents(query=query, documents=copy.deepcopy(docs))
Could we implement the deep-copy within the function "ranker.compress_documents"?
Below the testing codes leading to the above issues.
`from langchain.docstore.document import Document
from langchain_nvidia_ai_endpoints import NVIDIARerank
import os
os.environ["NVIDIA_API_KEY"]=""
ranker = NVIDIARerank()
docs = []
queries = []
for i in range(10):
docs.append(Document(page_content=str(i)))
queries.append(str(i) + "test")
IRs = []
for idx, query in enumerate(queries):
IRs.append(
ranker.compress_documents(query=query, documents=docs)
)
print(str(IRs[0]))`
The text was updated successfully, but these errors were encountered: