Spaces:
Sleeping
Sleeping
change embedding model
Browse files
app.py
CHANGED
@@ -159,8 +159,8 @@ class UploadDoc:
|
|
159 |
|
160 |
return documents
|
161 |
|
162 |
-
def split_docs(documents,chunk_size=
|
163 |
-
text_splitter = RecursiveCharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=
|
164 |
sp_docs = text_splitter.split_documents(documents)
|
165 |
return sp_docs
|
166 |
|
@@ -199,7 +199,7 @@ def set_custom_prompt():
|
|
199 |
|
200 |
@st.cache_resource
|
201 |
def load_embeddings():
|
202 |
-
embeddings = HuggingFaceEmbeddings(model_name = "
|
203 |
model_kwargs = {'device': 'cpu'})
|
204 |
return embeddings
|
205 |
|
|
|
159 |
|
160 |
return documents
|
161 |
|
162 |
+
def split_docs(documents,chunk_size=500):
|
163 |
+
text_splitter = RecursiveCharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=100)
|
164 |
sp_docs = text_splitter.split_documents(documents)
|
165 |
return sp_docs
|
166 |
|
|
|
199 |
|
200 |
@st.cache_resource
|
201 |
def load_embeddings():
|
202 |
+
embeddings = HuggingFaceEmbeddings(model_name = "all-MiniLM-L6-v2",
|
203 |
model_kwargs = {'device': 'cpu'})
|
204 |
return embeddings
|
205 |
|