deekshith-rj commited on
Commit
269a93e
1 Parent(s): 7ea56bf

Fixing a Runtime Error

Browse files

Error message:

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.).

Files changed (1) hide show
  1. src/utils.py +1 -1
src/utils.py CHANGED
@@ -280,7 +280,7 @@ def get_rag_chain():
280
  embed_model = HuggingFaceEmbeddings(model_name=model_name, model_kwargs=model_kwargs)
281
  llm = LlamaCpp(model_path=MODEL_PATH)
282
 
283
- db_vector = FAISS.load_local(FAISS_DB_PATH, embed_model)
284
  retriever = db_vector.as_retriever()
285
 
286
  return RetrievalQA.from_chain_type(
 
280
  embed_model = HuggingFaceEmbeddings(model_name=model_name, model_kwargs=model_kwargs)
281
  llm = LlamaCpp(model_path=MODEL_PATH)
282
 
283
+ db_vector = FAISS.load_local(FAISS_DB_PATH, embed_model, allow_dangerous_deserialization=True)
284
  retriever = db_vector.as_retriever()
285
 
286
  return RetrievalQA.from_chain_type(