Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,6 @@ logging.basicConfig(level=logging.DEBUG)
|
|
19 |
ABS_PATH = os.path.dirname(os.path.abspath(__file__))
|
20 |
DB_DIR = os.path.join(ABS_PATH, "db")
|
21 |
|
22 |
-
embeddings = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
|
23 |
#embedding_function
|
24 |
|
25 |
def replace_newlines_and_spaces(text):
|
@@ -52,6 +51,7 @@ def init_chromadb():
|
|
52 |
|
53 |
# Select which embeddings we want to use
|
54 |
#embeddings = OpenAIEmbeddings()
|
|
|
55 |
|
56 |
# Create the vectorestore to use as the index
|
57 |
vectorstore = Chroma.from_documents(texts, embeddings, persist_directory=DB_DIR)
|
@@ -77,7 +77,8 @@ def query_chromadb():
|
|
77 |
|
78 |
# Select which embeddings we want to use
|
79 |
#embeddings = OpenAIEmbeddings()
|
80 |
-
|
|
|
81 |
# Load Vector store from local disk
|
82 |
vectorstore = Chroma(persist_directory=DB_DIR, embedding_function=embeddings)
|
83 |
#vectorstore.persist()
|
|
|
19 |
ABS_PATH = os.path.dirname(os.path.abspath(__file__))
|
20 |
DB_DIR = os.path.join(ABS_PATH, "db")
|
21 |
|
|
|
22 |
#embedding_function
|
23 |
|
24 |
def replace_newlines_and_spaces(text):
|
|
|
51 |
|
52 |
# Select which embeddings we want to use
|
53 |
#embeddings = OpenAIEmbeddings()
|
54 |
+
embeddings = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
|
55 |
|
56 |
# Create the vectorestore to use as the index
|
57 |
vectorstore = Chroma.from_documents(texts, embeddings, persist_directory=DB_DIR)
|
|
|
77 |
|
78 |
# Select which embeddings we want to use
|
79 |
#embeddings = OpenAIEmbeddings()
|
80 |
+
embeddings = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
|
81 |
+
|
82 |
# Load Vector store from local disk
|
83 |
vectorstore = Chroma(persist_directory=DB_DIR, embedding_function=embeddings)
|
84 |
#vectorstore.persist()
|