pragneshbarik commited on
Commit
ac9e241
·
1 Parent(s): 0676ee0

removed debug print statement

Browse files
Files changed (2) hide show
  1. app.py +1 -0
  2. utils.py +7 -7
app.py CHANGED
@@ -326,6 +326,7 @@ sidebar()
326
  header()
327
  chat_box()
328
 
 
329
  if prompt := st.chat_input("Generate Ebook"):
330
  st.chat_message("user").markdown(prompt)
331
  st.session_state.messages.append({"role": "user", "content": prompt})
 
326
  header()
327
  chat_box()
328
 
329
+ # Main chat loop
330
  if prompt := st.chat_input("Generate Ebook"):
331
  st.chat_message("user").markdown(prompt)
332
  st.session_state.messages.append({"role": "user", "content": prompt})
utils.py CHANGED
@@ -22,16 +22,16 @@ bingSearchClient = SearchClient("bing", api_key=BING_SEARCH_API_KEY, engine_id=N
22
 
23
 
24
  def rerank(query, top_k, search_results, chunk_size):
25
- """Chunks and reranks the documents using specified reranker,
26
 
27
  Args:
28
- query (str): your query
29
- top_k (str): _description_
30
- search_results ([]{link:str, text:str}): _description_
31
- chunk_size (_type_): _description_
32
 
33
  Returns:
34
- _type_: []{link:str, text:str}
35
  """
36
  chunks = []
37
  for result in search_results:
@@ -114,7 +114,7 @@ def gen_augmented_prompt_via_websearch(
114
  # remove duplicate links
115
  links = list(set(links))
116
 
117
- print(reranked_results)
118
 
119
  prev_output = prev_output if pass_prev else ""
120
 
 
22
 
23
 
24
  def rerank(query, top_k, search_results, chunk_size):
25
+ """Chunks and reranks the documents using a specified reranker,
26
 
27
  Args:
28
+ query (str): the query for reranking
29
+ top_k (int): the number of top reranked results to return
30
+ search_results (list[dict]): a list of dictionaries containing "link" and "text" keys for each search result
31
+ chunk_size (int): the size of each chunk for reranking
32
 
33
  Returns:
34
+ list[dict]: a list of dictionaries containing the top reranked results with "link" and "text" keys
35
  """
36
  chunks = []
37
  for result in search_results:
 
114
  # remove duplicate links
115
  links = list(set(links))
116
 
117
+ # print(reranked_results)
118
 
119
  prev_output = prev_output if pass_prev else ""
120