paper-qa
paper-qa copied to clipboard
Error while saving
I'm trying to save the docs by the following snippet
llm = VertexAI(
verbose=True,
model_name="text-bison@001",
max_output_tokens=1024,
temperature=0.1,
top_p=0.99,
top_k=5,
)
embeddings = VertexAIEmbeddings()
docs = Docs(llm=llm, embeddings=embeddings)
for d in my_docs:
docs.add(d)
import pickle
with open("save.pkl", "wb") as f:
pickle.dump(docs, f)
But I keep getting this error:
Traceback (most recent call last):
File "gen_app.py", line 55, in <module>
pickle.dump(docs, f)
TypeError: cannot pickle '_thread.lock' object
Can you try embedding vertexAIEmbeddings alone? It's probably related to that not being serializable
Hello @saswat0, we have just released version 5, which completely outsources all LLM management to https://github.com/BerriAI/litellm.
So pickling of LLMs is now outsourced to LiteLLM. If your issue persists, please reopen a new issue using paper-qa>=5
Hello @saswat0, we have just released version 5, which completely outsources all LLM management to https://github.com/BerriAI/litellm.
So pickling of LLMs is now outsourced to LiteLLM. If your issue persists, please reopen a new issue using paper-qa>=5