eagle0504 commited on
Commit
ea28788
·
1 Parent(s): e3439d6

app top n content added

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -169,7 +169,12 @@ def main():
169
  if uploaded_file is not None:
170
  # Select token size:
171
  st.sidebar.success("Note: 1 Token ~ 4 Characters.")
172
- token_size = st.sidebar.slider('Select a token size (when we scrape the document)', 5, 150, 45)
 
 
 
 
 
173
 
174
  # To read file as bytes:
175
  bytes_data = uploaded_file.getvalue()
@@ -233,7 +238,7 @@ def main():
233
 
234
  # User input
235
  query = st.text_input("Ask me anything!", "What is the document about?")
236
- results = chroma_collection.query(query_texts=[query], n_results=5)
237
  retrieved_documents = results["documents"][0]
238
  results_as_table = pd.DataFrame(
239
  {
 
169
  if uploaded_file is not None:
170
  # Select token size:
171
  st.sidebar.success("Note: 1 Token ~ 4 Characters.")
172
+ token_size = st.sidebar.slider(
173
+ "Select a token size (when we scrape the document)", 5, 150, 45
174
+ )
175
+ top_n_content = st.sidebar.slider(
176
+ "Select top n content(s) you want to display as reference", 3, 30, 5
177
+ )
178
 
179
  # To read file as bytes:
180
  bytes_data = uploaded_file.getvalue()
 
238
 
239
  # User input
240
  query = st.text_input("Ask me anything!", "What is the document about?")
241
+ results = chroma_collection.query(query_texts=[query], n_results=top_n_content)
242
  retrieved_documents = results["documents"][0]
243
  results_as_table = pd.DataFrame(
244
  {