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
Traceback (most recent call last): File "D:\news agent\venv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 534, in _run_script exec(code, module.dict) File "D:\news agent\main.py", line 31, in final = qa.qaretriever(question,urls) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\news agent\qaretriever.py", line 35, in qaretriever pickle.dump(vector_index, f) TypeError: cannot pickle '_thread.RLock' object
The text was updated successfully, but these errors were encountered:
did you solve this ?
Sorry, something went wrong.
Hi, Were you able to solve this issue?
The answer is : We will have to use vectorstore methods only to dump into a file and retrieve it instead of using pickle
Just replaced the code
with open(file_path, "wb") as f: pickle.dump(vectorstore_openai, f)
With this line vectorstore_openai.save_local("vectorstore")
vectorstore_openai.save_local("vectorstore")
And
replace this code vectorstore = pickle.load(f) with vectorstore = FAISS.load_local("vectorstore", OpenAIEmbeddings(), allow_dangerous_deserialization=True)
vectorstore = pickle.load(f)
vectorstore = FAISS.load_local("vectorstore", OpenAIEmbeddings(), allow_dangerous_deserialization=True)
No branches or pull requests
Traceback (most recent call last):
File "D:\news agent\venv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 534, in _run_script
exec(code, module.dict)
File "D:\news agent\main.py", line 31, in
final = qa.qaretriever(question,urls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\news agent\qaretriever.py", line 35, in qaretriever
pickle.dump(vector_index, f)
TypeError: cannot pickle '_thread.RLock' object
The text was updated successfully, but these errors were encountered: