Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -338,18 +338,18 @@ def initialize():
|
|
| 338 |
doc_partial_paths = ['docs/source/setup/']
|
| 339 |
doc_file_paths = ['docs/source/usage/lib.rst']
|
| 340 |
|
| 341 |
-
|
| 342 |
-
print("LEEEEEEEEEEEENGTH of
|
| 343 |
|
| 344 |
|
| 345 |
-
|
| 346 |
-
print("LEEEEEEEEEEEENGTH of doc_files: ", len(
|
| 347 |
|
| 348 |
-
|
| 349 |
-
|
| 350 |
|
| 351 |
-
print(f"Total number of code_chunks: {len(
|
| 352 |
-
print(f"Total number of doc_chunks: {len(
|
| 353 |
|
| 354 |
docstore = setup_vectorstore(doc_chunks, EMBEDDING_MODEL_NAME, PERSIST_DOC_DIRECTORY)
|
| 355 |
codestore = setup_vectorstore(code_chunks, EMBEDDING_MODEL_NAME, PERSIST_CODE_DIRECTORY)
|
|
|
|
| 338 |
doc_partial_paths = ['docs/source/setup/']
|
| 339 |
doc_file_paths = ['docs/source/usage/lib.rst']
|
| 340 |
|
| 341 |
+
kadiAPY_code_texts, kadiAPY_code_references = process_directory(DATA_DIR, code_partial_paths, code_file_paths)
|
| 342 |
+
print("LEEEEEEEEEEEENGTH of code_texts: ", len(kadiAPY_code_texts))
|
| 343 |
|
| 344 |
|
| 345 |
+
kadiAPY_doc_texts, kadiAPY_doc_text_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(code_texts, code_text_references)
|
| 349 |
+
kadiAPY_doc_chunks = split_into_chunks(doc_file_texts, doc_file_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(doc_chunks, EMBEDDING_MODEL_NAME, PERSIST_DOC_DIRECTORY)
|
| 355 |
codestore = setup_vectorstore(code_chunks, EMBEDDING_MODEL_NAME, PERSIST_CODE_DIRECTORY)
|