SergeyO7 commited on
Commit
073c315
·
verified ·
1 Parent(s): 803fc12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -57,8 +57,8 @@ def load_documents():
57
 
58
  def split_text(documents: list[Document]):
59
  text_splitter = RecursiveCharacterTextSplitter(
60
- chunk_size=1000,
61
- chunk_overlap=200,
62
  length_function=len,
63
  add_start_index=True,
64
  )
@@ -75,7 +75,7 @@ def save_to_chroma(chunks: list[Document]):
75
  # Инициализация эмбеддингов
76
  embeddings = HuggingFaceEmbeddings(
77
  model_name="sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
78
- cache_folder="/tmp/model_cache",
79
  model_kwargs={'device': 'cpu'},
80
  encode_kwargs={'normalize_embeddings': True}
81
  )
 
57
 
58
  def split_text(documents: list[Document]):
59
  text_splitter = RecursiveCharacterTextSplitter(
60
+ chunk_size=900,
61
+ chunk_overlap=300,
62
  length_function=len,
63
  add_start_index=True,
64
  )
 
75
  # Инициализация эмбеддингов
76
  embeddings = HuggingFaceEmbeddings(
77
  model_name="sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
78
+ # cache_folder="/tmp/model_cache",
79
  model_kwargs={'device': 'cpu'},
80
  encode_kwargs={'normalize_embeddings': True}
81
  )