bupa1018 commited on
Commit
9ed2e92
·
1 Parent(s): e2aed95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -237,9 +237,19 @@ def split_into_chunks(texts, references, chunk_size, chunk_overlap):
237
  chunks = []
238
 
239
  for text, reference in zip(texts, references):
240
- chunks.extend([Document(page_content=chunk, metadata={"source": reference}) for chunk in text_splitter.split_text(text)])
 
 
 
 
 
 
 
 
 
241
  return chunks
242
 
 
243
  # Setup Vectorstore
244
  def embed_documents_into_vectorstore(chunks, model_name, persist_directory):
245
  print("Start setup_vectorstore_function")
 
237
  chunks = []
238
 
239
  for text, reference in zip(texts, references):
240
+ chunks.extend([
241
+ Document(
242
+ page_content=chunk,
243
+ metadata={
244
+ "source": reference,
245
+ "usage": "doc"
246
+ }
247
+ )
248
+ for chunk in text_splitter.split_text(text)
249
+ ])
250
  return chunks
251
 
252
+
253
  # Setup Vectorstore
254
  def embed_documents_into_vectorstore(chunks, model_name, persist_directory):
255
  print("Start setup_vectorstore_function")