mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 17:05:41 +01:00
Merge branch 'main' into main
This commit is contained in:
commit
f60dbb520e
4 changed files with 20 additions and 6 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue