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.).
Traceback:
File "C:\Users\siddh\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 542, in _run_script
exec(code, module.dict)
File "D:\gemini pro\P0\pdfapp.py", line 106, in
main()
File "D:\gemini pro\P0\pdfapp.py", line 91, in main
user_input(user_question)
File "D:\gemini pro\P0\pdfapp.py", line 68, in user_input
new_db = FAISS.load_local("faiss_index", embeddings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I have used Chat gpt to change the code as required but new error comes each time after 1 error is resolved
When i am running this code the error is coming
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
main()
File "D:\gemini pro\P0\pdfapp.py", line 91, in main
user_input(user_question)
File "D:\gemini pro\P0\pdfapp.py", line 68, in user_input
new_db = FAISS.load_local("faiss_index", embeddings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
allow_dangerous_deserialization
toTrue
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 toTrue
if you are loading a file from an untrusted source (e.g., some random site on the internet.). Traceback: File "C:\Users\siddh\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 542, in _run_script exec(code, module.dict) File "D:\gemini pro\P0\pdfapp.py", line 106, inI have used Chat gpt to change the code as required but new error comes each time after 1 error is resolved