Spaces:
Runtime error
Runtime error
abishek-official
commited on
Commit
•
f661324
1
Parent(s):
b26d323
Update app.py
Browse files
app.py
CHANGED
@@ -25,14 +25,14 @@ def get_text_chunks(text):
|
|
25 |
chunk_overlap=200,
|
26 |
length_function=len
|
27 |
)
|
28 |
-
chunks = text_splitter.
|
29 |
return chunks
|
30 |
|
31 |
|
32 |
def get_vectorstore(text_chunks):
|
33 |
#embeddings = OpenAIEmbeddings()
|
34 |
embeddings = HuggingFaceBgeEmbeddings(model_name="hkunlp/instructor-large")
|
35 |
-
vectorstore = FAISS.
|
36 |
return vectorstore
|
37 |
|
38 |
|
|
|
25 |
chunk_overlap=200,
|
26 |
length_function=len
|
27 |
)
|
28 |
+
chunks = text_splitter.split_documents(text)
|
29 |
return chunks
|
30 |
|
31 |
|
32 |
def get_vectorstore(text_chunks):
|
33 |
#embeddings = OpenAIEmbeddings()
|
34 |
embeddings = HuggingFaceBgeEmbeddings(model_name="hkunlp/instructor-large")
|
35 |
+
vectorstore = FAISS.from_documents(texts=text_chunks, embedding=embeddings)
|
36 |
return vectorstore
|
37 |
|
38 |
|