INNER CODE UNIT · Python
file_names2pickle
junruxiong/IncarnaMind · docs2db.py:115
def file_names2pickle(file_names: list, save_name: str = ""):
"""Save the list of file names to a pickle file.
Args:
file_names (list): The list of file names.
save_name (str, optional): The name for the saved pickle file. Defaults to "".
"""
name = f"{save_name}"
if not os.path.exists(embedding_store_path):
os.makedirs(embedding_store_path)
with open(f"{embedding_store_path}/{name}.pkl", "wb") as file:
pickle.dump(file_names, file)
def docs2pickle(docs: List[Document], suffix: str = ""):
"""Serializes a list of Document objects to a pickle file.
Args: