hymai commited on
Commit
9312801
·
verified ·
1 Parent(s): 3aff247

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -140,9 +140,12 @@ qa_prompt_tmpl = (
140
  qa_prompt = PromptTemplate(qa_prompt_tmpl)
141
  """
142
  # setting up query engine
 
 
143
  query_engine = RetrieverQueryEngine(
144
  retriever = retriever,
145
- node_postprocessors=[SimilarityPostprocessor(similarity_cutoff=0.53)],
 
146
  response_synthesizer=get_response_synthesizer(response_mode="tree_summarize",verbose=True)
147
  )
148
  print(query_engine.get_prompts())
 
140
  qa_prompt = PromptTemplate(qa_prompt_tmpl)
141
  """
142
  # setting up query engine
143
+ cohere_rerank = CohereRerank(api_key=api_key, top_n=5)
144
+ # setting up query engine
145
  query_engine = RetrieverQueryEngine(
146
  retriever = retriever,
147
+ #node_postprocessors=[SimilarityPostprocessor(similarity_cutoff=0.53)],
148
+ node_postprocessors=[SimilarityPostprocessor(similarity_cutoff=0.53), cohere_rerank],
149
  response_synthesizer=get_response_synthesizer(response_mode="tree_summarize",verbose=True)
150
  )
151
  print(query_engine.get_prompts())