Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -115,12 +115,13 @@ def rag_workflow(query):
|
|
| 115 |
print("Retrieved Document Contexts:", kadiAPY_doc_documents)
|
| 116 |
print("Retrieved Code Contexts:", kadiAPY_code_documents)
|
| 117 |
|
|
|
|
|
|
|
| 118 |
|
| 119 |
formatted_doc_snippets = rag_chain.format_documents(kadiAPY_doc_documents)
|
| 120 |
formatted_code_snippets = rag_chain.format_documents(kadiAPY_code_documents)
|
| 121 |
-
print("FORMATTED Retrieved Document Contexts:", formatted_doc_snippets)
|
| 122 |
-
print("FORMATTED Retrieved Code Contexts:" , formatted_code_snippets)
|
| 123 |
-
print(formatted_code_snippets)
|
| 124 |
# Step 4: Generate the final response
|
| 125 |
response = rag_chain.generate_response(query, formatted_doc_snippets, formatted_code_snippets)
|
| 126 |
print("Generated Response:", response)
|
|
@@ -150,7 +151,6 @@ def initialize():
|
|
| 150 |
print(f"Total number of code_chunks: {len(code_chunks)}")
|
| 151 |
print(f"Total number of doc_chunks: {len(doc_chunks)}")
|
| 152 |
|
| 153 |
-
filename = "test"
|
| 154 |
vector_store = embed_documents_into_vectorstore(doc_chunks + code_chunks, EMBEDDING_MODEL_NAME, f"{DATA_DIR}/{filename}")
|
| 155 |
llm = get_groq_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
|
| 156 |
|
|
|
|
| 115 |
print("Retrieved Document Contexts:", kadiAPY_doc_documents)
|
| 116 |
print("Retrieved Code Contexts:", kadiAPY_code_documents)
|
| 117 |
|
| 118 |
+
|
| 119 |
+
|
| 120 |
|
| 121 |
formatted_doc_snippets = rag_chain.format_documents(kadiAPY_doc_documents)
|
| 122 |
formatted_code_snippets = rag_chain.format_documents(kadiAPY_code_documents)
|
| 123 |
+
#print("FORMATTED Retrieved Document Contexts:", formatted_doc_snippets)
|
| 124 |
+
#print("FORMATTED Retrieved Code Contexts:" , formatted_code_snippets)
|
|
|
|
| 125 |
# Step 4: Generate the final response
|
| 126 |
response = rag_chain.generate_response(query, formatted_doc_snippets, formatted_code_snippets)
|
| 127 |
print("Generated Response:", response)
|
|
|
|
| 151 |
print(f"Total number of code_chunks: {len(code_chunks)}")
|
| 152 |
print(f"Total number of doc_chunks: {len(doc_chunks)}")
|
| 153 |
|
|
|
|
| 154 |
vector_store = embed_documents_into_vectorstore(doc_chunks + code_chunks, EMBEDDING_MODEL_NAME, f"{DATA_DIR}/{filename}")
|
| 155 |
llm = get_groq_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
|
| 156 |
|