Ronochieng commited on
Commit
717ae7e
·
verified ·
1 Parent(s): e77cbe8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -567,10 +567,11 @@ def setup_document_chat(processed_docs):
567
  ])
568
 
569
  # Process with model
570
- response = llm.invoke({
571
- "context": context,
572
- "question": query
573
- }) | llm
 
574
 
575
  return {"answer": response}
576
 
@@ -851,7 +852,8 @@ with tab2:
851
  ]
852
  template = ChatPromptTemplate.from_messages(messages)
853
 
854
- response = llm.invoke(template.invoke({"input": prompt}))
 
855
 
856
  # Try to parse the response into the pydantic model
857
  try:
 
567
  ])
568
 
569
  # Process with model
570
+ messages = template.format_messages(
571
+ context=context,
572
+ question=query
573
+ )
574
+ response = llm.invoke(messages)
575
 
576
  return {"answer": response}
577
 
 
852
  ]
853
  template = ChatPromptTemplate.from_messages(messages)
854
 
855
+ messages = template.format_messages(input=prompt)
856
+ response = llm.invoke(messages)
857
 
858
  # Try to parse the response into the pydantic model
859
  try: