ruggsea commited on
Commit
e83ec96
·
1 Parent(s): 83bdaa2
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -25,6 +25,7 @@ def load_indices():
25
  """Load the index and create retrievers"""
26
  # Load embeddings
27
  embed_model = HuggingFaceEmbedding(model_name="multi-qa-MiniLM-L6-cos-v1")
 
28
  Settings.embed_model = embed_model
29
 
30
  # Load index
@@ -94,13 +95,12 @@ if search_query:
94
  # Format score to 3 decimal places
95
  score = f"{node.score:.3f}" if hasattr(node, 'score') else "N/A"
96
 
97
- # Main text expander
98
  with st.expander(f"Result {i} (score: {score})\n\n{preview}", expanded=False):
99
  st.markdown(node.text)
100
-
101
- # Separate metadata expander
102
- if node.metadata:
103
- with st.expander(f"Result {i} - Metadata", expanded=False):
104
  st.json(node.metadata)
105
 
106
  # Add sidebar with information
 
25
  """Load the index and create retrievers"""
26
  # Load embeddings
27
  embed_model = HuggingFaceEmbedding(model_name="multi-qa-MiniLM-L6-cos-v1")
28
+ Settings.llm = None
29
  Settings.embed_model = embed_model
30
 
31
  # Load index
 
95
  # Format score to 3 decimal places
96
  score = f"{node.score:.3f}" if hasattr(node, 'score') else "N/A"
97
 
98
+ # Create expandable container with new title format
99
  with st.expander(f"Result {i} (score: {score})\n\n{preview}", expanded=False):
100
  st.markdown(node.text)
101
+ if node.metadata:
102
+ st.markdown("---")
103
+ st.markdown("**Source:**")
 
104
  st.json(node.metadata)
105
 
106
  # Add sidebar with information