Spaces:
Sleeping
Sleeping
Commit
·
1f55313
1
Parent(s):
fb442dd
fixed responce synthesizer problem
Browse files
app.py
CHANGED
|
@@ -23,10 +23,18 @@ def answer_question(question, history):
|
|
| 23 |
try:
|
| 24 |
start_time = time.time()
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
if chat_engine is None:
|
| 27 |
chat_engine = CondensePlusContextChatEngine.from_defaults(
|
| 28 |
retriever=query_engine.retriever,
|
| 29 |
-
response_synthesizer=
|
| 30 |
)
|
| 31 |
|
| 32 |
response = chat_engine.chat(question)
|
|
|
|
| 23 |
try:
|
| 24 |
start_time = time.time()
|
| 25 |
|
| 26 |
+
custom_prompt_template = PromptTemplate(CUSTOM_PROMPT_NEW)
|
| 27 |
+
|
| 28 |
+
response_synthesizer = get_response_synthesizer(
|
| 29 |
+
response_mode=ResponseMode.TREE_SUMMARIZE,
|
| 30 |
+
text_qa_template=custom_prompt_template
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
|
| 34 |
if chat_engine is None:
|
| 35 |
chat_engine = CondensePlusContextChatEngine.from_defaults(
|
| 36 |
retriever=query_engine.retriever,
|
| 37 |
+
response_synthesizer=response_synthesizer,
|
| 38 |
)
|
| 39 |
|
| 40 |
response = chat_engine.chat(question)
|