Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -147,14 +147,18 @@ st.write("π **Vector Store Created:**", st.session_state.vector_created)
|
|
| 147 |
if query:
|
| 148 |
with st.spinner("π Retrieving relevant context..."):
|
| 149 |
retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 5})
|
| 150 |
-
|
| 151 |
-
context = [d.page_content for d in
|
| 152 |
st.success("β
Context retrieved successfully!")
|
| 153 |
-
|
|
|
|
| 154 |
# ----------------- Run Individual Chains Explicitly -----------------
|
| 155 |
|
| 156 |
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
# ----------------- Display All Outputs -----------------
|
| 160 |
st.markdown("### Context Relevancy Evaluation")
|
|
|
|
| 147 |
if query:
|
| 148 |
with st.spinner("π Retrieving relevant context..."):
|
| 149 |
retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 5})
|
| 150 |
+
contexts = retriever.invoke(query)
|
| 151 |
+
context = [d.page_content for d in contexts]
|
| 152 |
st.success("β
Context retrieved successfully!")
|
| 153 |
+
st.write(contexts, len(contexts))
|
| 154 |
+
st.write(context, len(context))
|
| 155 |
# ----------------- Run Individual Chains Explicitly -----------------
|
| 156 |
|
| 157 |
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
|
| 162 |
|
| 163 |
# ----------------- Display All Outputs -----------------
|
| 164 |
st.markdown("### Context Relevancy Evaluation")
|