Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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=
|
61 |
-
chunk_overlap=
|
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 |
)
|