Open sambantham-p opened 1 year ago
did you solve this ?
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")
And
replace this code
vectorstore = pickle.load(f)
with
vectorstore = FAISS.load_local("vectorstore", OpenAIEmbeddings(), allow_dangerous_deserialization=True)
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