Tamil Eniyan commited on
Commit
20c970d
·
1 Parent(s): 076c725

Add application file

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -46,12 +46,16 @@ def main():
46
  k = 3
47
  distances, indices = index.search(query_embedding, k)
48
 
49
- st.subheader("Retrieved Context:")
50
  context = ""
51
  for idx in indices[0]:
52
  context_piece = chunks[idx]
53
  context += context_piece + " "
54
- st.write(context_piece)
 
 
 
 
55
 
56
  st.subheader("Answer:")
57
  try:
 
46
  k = 3
47
  distances, indices = index.search(query_embedding, k)
48
 
49
+ # Prepare combined context from the retrieved chunks
50
  context = ""
51
  for idx in indices[0]:
52
  context_piece = chunks[idx]
53
  context += context_piece + " "
54
+
55
+ # Use an expander to optionally display the retrieved context
56
+ with st.expander("Show Retrieved Context"):
57
+ for idx in indices[0]:
58
+ st.write(chunks[idx])
59
 
60
  st.subheader("Answer:")
61
  try: