bupa1018 commited on
Commit
0c35020
·
1 Parent(s): a4c5e4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -10
app.py CHANGED
@@ -326,16 +326,24 @@ def rag_workflow(query):
326
 
327
 
328
  def initialize():
329
- global vectorstore, chunks, llm
330
-
331
- partial_paths = ['kadi_apy/lib/resources/']
332
- file_paths = []
333
- #partial_paths = ['docs/source/setup/', 'kadi_apy/lib/']
334
- #file_paths = ['docs/source/usage/lib.rst']
335
- all_texts, file_references = process_directory(REPOSITORY_DIRECTORY, partial_paths, file_paths)
336
- chunks = split_pythoncode_into_chunks(all_texts, file_references, 512, 0)
337
- #chunks = split_into_chunks(all_texts, file_references, 512, 0)
338
- print(f"Total number of chunks: {len(chunks)}")
 
 
 
 
 
 
 
 
339
  # vectorstore = setup_chroma(chunks, EMBEDDING_MODEL_NAME, PERSIST_DIRECTORY)
340
  # llm = setup_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
341
 
 
326
 
327
 
328
  def initialize():
329
+ global docstore, vectorstore, chunks, llm
330
+
331
+ code_partial_paths = ['kadi_apy/lib/resources/']
332
+ code_file_path = []
333
+ doc_partial_paths = ['docs/source/setup/']
334
+ doc_file_paths = ['docs/source/usage/lib.rst']
335
+
336
+
337
+ doc_files, doc_file_references = process_directory(REPOSITORY_DIRECTORY, partial_paths, file_paths)
338
+
339
+ doc_files, doc_file_references = process_directory(REPOSITORY_DIRECTORY, partial_paths, file_paths)
340
+
341
+ code_chunks = split_pythoncode_into_chunks(doc_files, doc_file_references, 1500, 0)
342
+ doc_chunks = split_into_chunks(all_texts, file_references, 1024, 128)
343
+
344
+ print(f"Total number of code_chunks: {len(code_chunks)}")
345
+ print(f"Total number of code_chunks: {len(doc_chunks)}")
346
+
347
  # vectorstore = setup_chroma(chunks, EMBEDDING_MODEL_NAME, PERSIST_DIRECTORY)
348
  # llm = setup_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
349