Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -140,7 +140,7 @@ def rag_workflow(query):
|
|
140 |
formatted_doc_snippets = rag_chain.format_documents(kadiAPY_doc_documents)
|
141 |
formatted_code_snippets = rag_chain.format_documents(kadiAPY_code_documents)
|
142 |
print("FORMATTED Retrieved Document Contexts:", formatted_doc_snippets)
|
143 |
-
print("FORMATTED Retrieved Code Contexts:" ,
|
144 |
print(formatted_code_snippets)
|
145 |
# Step 4: Generate the final response
|
146 |
response = rag_chain.generate_response(query, formatted_doc_snippets, formatted_code_snippets)
|
@@ -160,13 +160,13 @@ def initialize():
|
|
160 |
)
|
161 |
|
162 |
code_texts, code_references = extract_files_and_filepath_from_dir(DATA_DIR, ['kadi_apy'], [])
|
163 |
-
doc_texts,
|
164 |
|
165 |
print("LEEEEEEEEEEEENGTH of code_texts: ", len(code_texts))
|
166 |
print("LEEEEEEEEEEEENGTH of doc_files: ", len(doc_texts))
|
167 |
|
168 |
code_chunks = split_python_code_into_chunks(code_texts, code_references)
|
169 |
-
doc_chunks = split_into_chunks(doc_texts,
|
170 |
|
171 |
print(f"Total number of code_chunks: {len(code_chunks)}")
|
172 |
print(f"Total number of doc_chunks: {len(doc_chunks)}")
|
|
|
140 |
formatted_doc_snippets = rag_chain.format_documents(kadiAPY_doc_documents)
|
141 |
formatted_code_snippets = rag_chain.format_documents(kadiAPY_code_documents)
|
142 |
print("FORMATTED Retrieved Document Contexts:", formatted_doc_snippets)
|
143 |
+
print("FORMATTED Retrieved Code Contexts:" , formatted_code_snippets)
|
144 |
print(formatted_code_snippets)
|
145 |
# Step 4: Generate the final response
|
146 |
response = rag_chain.generate_response(query, formatted_doc_snippets, formatted_code_snippets)
|
|
|
160 |
)
|
161 |
|
162 |
code_texts, code_references = extract_files_and_filepath_from_dir(DATA_DIR, ['kadi_apy'], [])
|
163 |
+
doc_texts, doc_references = extract_files_and_filepath_from_dir(DATA_DIR, ['docs/source/'], [])
|
164 |
|
165 |
print("LEEEEEEEEEEEENGTH of code_texts: ", len(code_texts))
|
166 |
print("LEEEEEEEEEEEENGTH of doc_files: ", len(doc_texts))
|
167 |
|
168 |
code_chunks = split_python_code_into_chunks(code_texts, code_references)
|
169 |
+
doc_chunks = split_into_chunks(doc_texts, doc_references, CHUNK_SIZE, CHUNK_OVERLAP)
|
170 |
|
171 |
print(f"Total number of code_chunks: {len(code_chunks)}")
|
172 |
print(f"Total number of doc_chunks: {len(doc_chunks)}")
|