vectorstore
Browse files
app.py
CHANGED
@@ -34,7 +34,13 @@ login(token=HF_KEY)
|
|
34 |
|
35 |
class BSIChatbot:
|
36 |
def __init__(self, model_paths: Dict[str, str], docs_path: str):
|
37 |
-
self.embedding_model = None
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
self.llmpipeline = None
|
39 |
self.llmtokenizer = None
|
40 |
self.vectorstore = None
|
@@ -52,12 +58,7 @@ class BSIChatbot:
|
|
52 |
raw_knowledge_base = []
|
53 |
|
54 |
# Initialize embedding model
|
55 |
-
|
56 |
-
model_name=self.word_and_embed_model_path,
|
57 |
-
multi_process=True,
|
58 |
-
model_kwargs={"device": "cuda"},
|
59 |
-
encode_kwargs={"normalize_embeddings": True},
|
60 |
-
)
|
61 |
|
62 |
if rebuild_embeddings:
|
63 |
# Load documents
|
|
|
34 |
|
35 |
class BSIChatbot:
|
36 |
def __init__(self, model_paths: Dict[str, str], docs_path: str):
|
37 |
+
#self.embedding_model = None
|
38 |
+
self.embedding_model = HuggingFaceEmbeddings(
|
39 |
+
model_name=self.word_and_embed_model_path,
|
40 |
+
multi_process=True,
|
41 |
+
model_kwargs={"device": "cuda"},
|
42 |
+
encode_kwargs={"normalize_embeddings": True},
|
43 |
+
)
|
44 |
self.llmpipeline = None
|
45 |
self.llmtokenizer = None
|
46 |
self.vectorstore = None
|
|
|
58 |
raw_knowledge_base = []
|
59 |
|
60 |
# Initialize embedding model
|
61 |
+
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
if rebuild_embeddings:
|
64 |
# Load documents
|