Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -342,17 +342,17 @@ def initialize():
|
|
342 |
print("LEEEEEEEEEEEENGTH of code_texts: ", len(kadiAPY_code_texts))
|
343 |
|
344 |
|
345 |
-
kadiAPY_doc_texts,
|
346 |
print("LEEEEEEEEEEEENGTH of doc_files: ", len(kadiAPY_doc_texts))
|
347 |
|
348 |
kadiAPY_code_chunks = split_python_code_into_chunks(kadiAPY_code_texts, kadiAPY_code_references)
|
349 |
-
kadiAPY_doc_chunks = split_into_chunks(kadiAPY_doc_texts,
|
350 |
|
351 |
print(f"Total number of code_chunks: {len(kadiAPY_code_chunks)}")
|
352 |
print(f"Total number of doc_chunks: {len(kadiAPY_doc_chunks)}")
|
353 |
|
354 |
-
docstore = setup_vectorstore(
|
355 |
-
codestore = setup_vectorstore(
|
356 |
|
357 |
llm = setup_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
|
358 |
|
|
|
342 |
print("LEEEEEEEEEEEENGTH of code_texts: ", len(kadiAPY_code_texts))
|
343 |
|
344 |
|
345 |
+
kadiAPY_doc_texts, kadiAPY_doc_references = process_directory(DATA_DIR, doc_partial_paths, doc_file_paths)
|
346 |
print("LEEEEEEEEEEEENGTH of doc_files: ", len(kadiAPY_doc_texts))
|
347 |
|
348 |
kadiAPY_code_chunks = split_python_code_into_chunks(kadiAPY_code_texts, kadiAPY_code_references)
|
349 |
+
kadiAPY_doc_chunks = split_into_chunks(kadiAPY_doc_texts, kadiAPY_doc_references, CHUNK_SIZE, CHUNK_OVERLAP)
|
350 |
|
351 |
print(f"Total number of code_chunks: {len(kadiAPY_code_chunks)}")
|
352 |
print(f"Total number of doc_chunks: {len(kadiAPY_doc_chunks)}")
|
353 |
|
354 |
+
docstore = setup_vectorstore(kadiAPY_code_chunks, EMBEDDING_MODEL_NAME, PERSIST_DOC_DIRECTORY)
|
355 |
+
codestore = setup_vectorstore(kadiAPY_doc_chunks, EMBEDDING_MODEL_NAME, PERSIST_CODE_DIRECTORY)
|
356 |
|
357 |
llm = setup_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
|
358 |
|