kamkol commited on
Commit
4339e8e
·
1 Parent(s): 826e9b3

Clean up lcel_rag_chain

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -145,6 +145,7 @@ hf_llm = HuggingFaceEndpoint(
145
  typical_p=0.95,
146
  temperature=0.01,
147
  repetition_penalty=1.03,
 
148
  )
149
 
150
  @cl.author_rename
@@ -170,7 +171,10 @@ async def start_chat():
170
  """
171
 
172
  ### BUILD LCEL RAG CHAIN THAT ONLY RETURNS TEXT
173
- lcel_rag_chain = rag_prompt | hf_llm
 
 
 
174
 
175
  cl.user_session.set("lcel_rag_chain", lcel_rag_chain)
176
 
 
145
  typical_p=0.95,
146
  temperature=0.01,
147
  repetition_penalty=1.03,
148
+ huggingfacehub_api_token=HF_TOKEN,
149
  )
150
 
151
  @cl.author_rename
 
171
  """
172
 
173
  ### BUILD LCEL RAG CHAIN THAT ONLY RETURNS TEXT
174
+ lcel_rag_chain = (
175
+ {"context": itemgetter("query") | hf_retriever, "query": itemgetter("query")}
176
+ | rag_prompt | hf_llm
177
+ )
178
 
179
  cl.user_session.set("lcel_rag_chain", lcel_rag_chain)
180