mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-09-10 19:49:34 +00:00
Merge branch 'main' into main
This commit is contained in:
@@ -3,6 +3,8 @@ from langchain.document_loaders import TextLoader, PDFMinerLoader, CSVLoader
|
||||
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
||||
from langchain.vectorstores import Chroma
|
||||
from langchain.embeddings import LlamaCppEmbeddings
|
||||
from constants import PERSIST_DIRECTORY
|
||||
from constants import CHROMA_SETTINGS
|
||||
|
||||
def main():
|
||||
llama_embeddings_model = os.environ.get('LLAMA_EMBEDDINGS_MODEL')
|
||||
@@ -23,7 +25,7 @@ def main():
|
||||
# Create embeddings
|
||||
llama = LlamaCppEmbeddings(model_path=llama_embeddings_model, n_ctx=model_n_ctx)
|
||||
# Create and store locally vectorstore
|
||||
db = Chroma.from_documents(texts, llama, persist_directory=persist_directory)
|
||||
db = Chroma.from_documents(texts, llama, persist_directory=PERSIST_DIRECTORY, client_settings=CHROMA_SETTINGS)
|
||||
db.persist()
|
||||
db = None
|
||||
|
||||
|
Reference in New Issue
Block a user