Muhammad Qasim
commited on
Commit
·
f5808e4
1
Parent(s):
19c3f9c
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,8 @@ def get_text_chunks(text):
|
|
36 |
def get_vectorstore(text_chunks):
|
37 |
# embeddings = OpenAIEmbeddings()
|
38 |
print("HuggingFaceInstructEmbeddings")
|
39 |
-
|
|
|
40 |
print("FAISS.from_texts")
|
41 |
vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
42 |
print("returning vectorstore")
|
|
|
36 |
def get_vectorstore(text_chunks):
|
37 |
# embeddings = OpenAIEmbeddings()
|
38 |
print("HuggingFaceInstructEmbeddings")
|
39 |
+
model_kwargs = {'device': 'cpu', 'weights_only': True}
|
40 |
+
embeddings = HuggingFaceInstructEmbeddings(model_name="hkunlp/instructor-xl", model_kwargs=model_kwargs)
|
41 |
print("FAISS.from_texts")
|
42 |
vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
43 |
print("returning vectorstore")
|