krishnaik06 / Complete-Langchain-Tutorials

GNU General Public License v2.0
321 stars 272 forks source link

dangerous_deserialization #10

Closed jezbravo closed 6 months ago

jezbravo commented 6 months ago

Hello! I'm getting this error in the PDF app:

"ValueError: The de-serialization relies loading a pickle file. Pickle files can be modified to deliver a malicious payload that results in execution of arbitrary code on your machine.You will need to set allow_dangerous_deserialization to True to enable deserialization. If you do this, make sure that you trust the source of the data. For example, if you are loading a file that you created, and no that no one else has modified the file, then this is safe to do. Do not set this to True if you are loading a file from an untrusted source (e.g., some random site on the internet.)."

jezbravo commented 6 months ago

Fixed it this way: new_db = FAISS.load_local("faiss_index", embeddings, allow_dangerous_deserialization=True)