Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -567,10 +567,11 @@ def setup_document_chat(processed_docs):
|
|
| 567 |
])
|
| 568 |
|
| 569 |
# Process with model
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
|
|
|
| 574 |
|
| 575 |
return {"answer": response}
|
| 576 |
|
|
@@ -851,7 +852,8 @@ with tab2:
|
|
| 851 |
]
|
| 852 |
template = ChatPromptTemplate.from_messages(messages)
|
| 853 |
|
| 854 |
-
|
|
|
|
| 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:
|