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.).
Below is my code :-
llm = GoogleGenerativeAI(model="models/text-bison-001", google_api_key='AIzaSyACYXFNyYnyxIh_yQZlPklnJWUDE3IUh8g', temperature=0.6)
instructor_embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-large")
vectordb_file_path="faiss_index"
def create_vector_db():
loader = CSVLoader(file_path="./Roadmap_model.csv", source_column="prompt", encoding='iso-8859-1')
data = loader.load()
vectordb = FAISS.from_documents(documents=data,embedding=instructor_embeddings)
vectordb.save_local(vectordb_file_path)