Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -179,19 +179,6 @@ if query:
|
|
| 179 |
with st.spinner("π Retrieving relevant context..."):
|
| 180 |
retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 5})
|
| 181 |
contexts = retriever.invoke(query)
|
| 182 |
-
# Debugging: Check what was retrieved
|
| 183 |
-
#st.write("Retrieved Contexts:", contexts)
|
| 184 |
-
#st.write("Number of Contexts:", len(contexts)
|
| 185 |
-
|
| 186 |
-
context = [d.page_content for d in contexts]
|
| 187 |
-
# Debugging: Check extracted context
|
| 188 |
-
#st.write("Extracted Context (page_content):", context)
|
| 189 |
-
#st.write("Number of Extracted Contexts:", len(context))
|
| 190 |
-
|
| 191 |
-
#st.write("π **Relevant Passages Retrieved:**")
|
| 192 |
-
#for idx, doc in enumerate(contexts):
|
| 193 |
-
#st.write(f"**Excerpt {idx+1}:** {doc.page_content}")
|
| 194 |
-
|
| 195 |
|
| 196 |
relevancy_prompt = """You are an expert judge tasked with evaluating whether the EACH OF THE CONTEXT provided in the CONTEXT LIST is self sufficient to answer the QUERY asked.
|
| 197 |
Analyze the provided QUERY AND CONTEXT to determine if each Ccontent in the CONTEXT LIST contains Relevant information to answer the QUERY.
|
|
@@ -207,7 +194,7 @@ if query:
|
|
| 207 |
- 1: The content does not has the necessary information to answer the QUERY
|
| 208 |
|
| 209 |
|
| 210 |
-
EXAMPLE:
|
| 211 |
INPUT (for context only, not to be used for faithfulness evaluation):
|
| 212 |
What is the capital of France?
|
| 213 |
|
|
|
|
| 179 |
with st.spinner("π Retrieving relevant context..."):
|
| 180 |
retriever = st.session_state.vector_store.as_retriever(search_type="similarity", search_kwargs={"k": 5})
|
| 181 |
contexts = retriever.invoke(query)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
|
| 183 |
relevancy_prompt = """You are an expert judge tasked with evaluating whether the EACH OF THE CONTEXT provided in the CONTEXT LIST is self sufficient to answer the QUERY asked.
|
| 184 |
Analyze the provided QUERY AND CONTEXT to determine if each Ccontent in the CONTEXT LIST contains Relevant information to answer the QUERY.
|
|
|
|
| 194 |
- 1: The content does not has the necessary information to answer the QUERY
|
| 195 |
|
| 196 |
|
| 197 |
+
EXAMPLE:
|
| 198 |
INPUT (for context only, not to be used for faithfulness evaluation):
|
| 199 |
What is the capital of France?
|
| 200 |
|