Update pages/bot.py
Browse files- pages/bot.py +2 -3
pages/bot.py
CHANGED
@@ -19,7 +19,6 @@ from langchain.llms import HuggingFaceHub
|
|
19 |
#pip install InstructorEmbedding
|
20 |
###############
|
21 |
|
22 |
-
os.environ['SENTENCE_TRANSFORMERS_HOME'] = './.cache'
|
23 |
|
24 |
# PDF in String umwandeln
|
25 |
def get_pdf_text(folder_path):
|
@@ -51,7 +50,7 @@ def get_text_chunks(text):
|
|
51 |
|
52 |
# nur zum Anlegen des lokalen Verzeichnisses "Store" und speichern der Vektor-Datenbank
|
53 |
def create_vectorstore_and_store(text_chunks):
|
54 |
-
embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-base"
|
55 |
# Initiate Faiss DB
|
56 |
vectorstoreDB = FAISS.from_texts(texts=text_chunks,embedding=embeddings)#texts=text_chunks,
|
57 |
###
|
@@ -67,7 +66,7 @@ def create_vectorstore_and_store(text_chunks):
|
|
67 |
########
|
68 |
|
69 |
def get_vectorstore():
|
70 |
-
embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-base"
|
71 |
#Abruf lokaler Vektordatenbank
|
72 |
save_directory = "Store"
|
73 |
vectorstoreDB = FAISS.load_local(save_directory, embeddings)
|
|
|
19 |
#pip install InstructorEmbedding
|
20 |
###############
|
21 |
|
|
|
22 |
|
23 |
# PDF in String umwandeln
|
24 |
def get_pdf_text(folder_path):
|
|
|
50 |
|
51 |
# nur zum Anlegen des lokalen Verzeichnisses "Store" und speichern der Vektor-Datenbank
|
52 |
def create_vectorstore_and_store(text_chunks):
|
53 |
+
embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-base")
|
54 |
# Initiate Faiss DB
|
55 |
vectorstoreDB = FAISS.from_texts(texts=text_chunks,embedding=embeddings)#texts=text_chunks,
|
56 |
###
|
|
|
66 |
########
|
67 |
|
68 |
def get_vectorstore():
|
69 |
+
embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-base")
|
70 |
#Abruf lokaler Vektordatenbank
|
71 |
save_directory = "Store"
|
72 |
vectorstoreDB = FAISS.load_local(save_directory, embeddings)
|