SiraH commited on
Commit
0820ec4
1 Parent(s): 917e206

change embedding model

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -159,8 +159,8 @@ class UploadDoc:
159
 
160
  return documents
161
 
162
- def split_docs(documents,chunk_size=1000):
163
- text_splitter = RecursiveCharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=200)
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 = "thenlper/gte-small",
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