Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -326,16 +326,24 @@ def rag_workflow(query):
|
|
| 326 |
|
| 327 |
|
| 328 |
def initialize():
|
| 329 |
-
global vectorstore, chunks, llm
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|