Spaces:
Sleeping
Sleeping
| from langchain_chroma import Chroma | |
| DB_PATH = "./app/db/chroma_db" | |
| def create_vector_store(chunks, embedding_model): | |
| db = Chroma.from_documents( | |
| documents=chunks, | |
| embedding=embedding_model, | |
| persist_directory=DB_PATH | |
| ) | |
| return db | |
| def load_vector_store(embedding_model): | |
| return Chroma( | |
| persist_directory=DB_PATH, | |
| embedding_function=embedding_model | |
| ) |