Update app.py
Browse files
app.py
CHANGED
@@ -152,15 +152,7 @@ if query:
|
|
152 |
st.success("β
Context retrieved successfully!")
|
153 |
|
154 |
# ----------------- Run Individual Chains Explicitly -----------------
|
155 |
-
|
156 |
-
relevant_context_chain = LLMChain(llm=llm_judge, prompt=PromptTemplate(input_variables=["relevancy_response"], template=relevant_context_picker_prompt), output_key="context_number")
|
157 |
-
relevant_contexts_chain = LLMChain(llm=llm_judge, prompt=PromptTemplate(input_variables=["context_number", "context"], template=response_synth), output_key="relevant_contexts")
|
158 |
-
response_chain = LLMChain(llm=rag_llm, prompt=PromptTemplate(input_variables=["query", "context"], template=rag_prompt), output_key="final_response")
|
159 |
-
|
160 |
-
response_crisis = context_relevancy_chain.invoke({"context": context, "retriever_query": query})
|
161 |
-
relevant_response = relevant_context_chain.invoke({"relevancy_response": response_crisis["relevancy_response"]})
|
162 |
-
contexts = relevant_contexts_chain.invoke({"context_number": relevant_response["context_number"], "context": context})
|
163 |
-
final_response = response_chain.invoke({"query": query, "context": contexts["relevant_contexts"]})
|
164 |
|
165 |
# ----------------- Display All Outputs -----------------
|
166 |
st.markdown("### Context Relevancy Evaluation")
|
|
|
152 |
st.success("β
Context retrieved successfully!")
|
153 |
|
154 |
# ----------------- Run Individual Chains Explicitly -----------------
|
155 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
# ----------------- Display All Outputs -----------------
|
158 |
st.markdown("### Context Relevancy Evaluation")
|