Ritesh-hf commited on
Commit
f970298
·
verified ·
1 Parent(s): ae537b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -78,7 +78,7 @@ retriever = PineconeHybridSearchRetriever(
78
  embeddings=embed_model,
79
  sparse_encoder=bm25,
80
  index=pinecone_index,
81
- top_k=20,
82
  alpha=0.5,
83
  )
84
 
@@ -99,10 +99,10 @@ llm = ChatPerplexity(temperature=0, pplx_api_key=GROQ_API_KEY, model="llama-3.1-
99
  # base_compressor=compressor, base_retriever=retriever
100
  # )
101
 
102
- compressor = FlashrankRerank(top_n=10)
103
- compression_retriever = ContextualCompressionRetriever(
104
- base_compressor=compressor, base_retriever=retriever
105
- )
106
 
107
  # Contextualization prompt and retriever
108
  contextualize_q_system_prompt = """Given a chat history and the latest user question \
@@ -117,7 +117,7 @@ contextualize_q_prompt = ChatPromptTemplate.from_messages(
117
  ("human", "{input}")
118
  ]
119
  )
120
- history_aware_retriever = create_history_aware_retriever(llm, compression_retriever, contextualize_q_prompt)
121
 
122
  # QA system prompt and chain
123
  qa_system_prompt = """ You are a highly skilled information retrieval assistant. Use the following context to answer questions effectively.
 
78
  embeddings=embed_model,
79
  sparse_encoder=bm25,
80
  index=pinecone_index,
81
+ top_k=10,
82
  alpha=0.5,
83
  )
84
 
 
99
  # base_compressor=compressor, base_retriever=retriever
100
  # )
101
 
102
+ # compressor = FlashrankRerank(top_n=10)
103
+ # compression_retriever = ContextualCompressionRetriever(
104
+ # base_compressor=compressor, base_retriever=retriever
105
+ # )
106
 
107
  # Contextualization prompt and retriever
108
  contextualize_q_system_prompt = """Given a chat history and the latest user question \
 
117
  ("human", "{input}")
118
  ]
119
  )
120
+ history_aware_retriever = create_history_aware_retriever(llm, retriever, contextualize_q_prompt)
121
 
122
  # QA system prompt and chain
123
  qa_system_prompt = """ You are a highly skilled information retrieval assistant. Use the following context to answer questions effectively.