Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -334,18 +334,23 @@ query_generator_template_llama2 = f"<s>[INST] <<SYS>>{query_generator_message}<<
|
|
334 |
|
335 |
|
336 |
# 2. ็ๆใใใ่ณชๅๆใ็จใใฆใๅ่ๆ็ฎใ่ฆ็ดใใchain ใฎใใญใณใใ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
question_prompt_message = """
|
338 |
-
|
339 |
-
and summarize it in a natural English sentence with clear subject, verb, object,
|
340 |
-
|
341 |
-
do not summarize and simply answer "NO INFO"
|
342 |
-
""".replace("\n", "")
|
343 |
|
344 |
question_prompt_common_format = """
|
345 |
===
|
346 |
[Question] {query}
|
347 |
[references] {context}
|
348 |
-
[
|
349 |
|
350 |
question_prompt_template_std = f"{question_prompt_message}{question_prompt_common_format}"
|
351 |
question_prompt_template_llama2 = f"<s>[INST] <<SYS>>{question_prompt_message}<</SYS>>{question_prompt_common_format}[/INST]"
|
@@ -570,7 +575,7 @@ def set_chains(ss: SessionState, summarization_mode) -> SessionState:
|
|
570 |
ss.conversation_chain = ConversationChain(
|
571 |
llm = ss.llm,
|
572 |
prompt = chat_prompt,
|
573 |
-
memory = ss.memory,
|
574 |
input_key = "query",
|
575 |
output_key = "output_text",
|
576 |
verbose = True,
|
|
|
334 |
|
335 |
|
336 |
# 2. ็ๆใใใ่ณชๅๆใ็จใใฆใๅ่ๆ็ฎใ่ฆ็ดใใchain ใฎใใญใณใใ
|
337 |
+
# question_prompt_message = """
|
338 |
+
# From the following references, extract key information relevant to the question
|
339 |
+
# and summarize it in a natural English sentence with clear subject, verb, object,
|
340 |
+
# and complement. If there is no information in the reference that answers the question,
|
341 |
+
# do not summarize and simply answer "NO INFO"
|
342 |
+
# """.replace("\n", "")
|
343 |
+
|
344 |
question_prompt_message = """
|
345 |
+
1. Determine if any of the following references provide information that answers the Question, and if there is no information, answer "NO INFO" and stop.
|
346 |
+
2. From the following references, extract key information relevant to the question and summarize it in a natural English sentence with clear subject, verb, object,ใand complement.
|
347 |
+
""".strip()
|
|
|
|
|
348 |
|
349 |
question_prompt_common_format = """
|
350 |
===
|
351 |
[Question] {query}
|
352 |
[references] {context}
|
353 |
+
[Answer]"""
|
354 |
|
355 |
question_prompt_template_std = f"{question_prompt_message}{question_prompt_common_format}"
|
356 |
question_prompt_template_llama2 = f"<s>[INST] <<SYS>>{question_prompt_message}<</SYS>>{question_prompt_common_format}[/INST]"
|
|
|
575 |
ss.conversation_chain = ConversationChain(
|
576 |
llm = ss.llm,
|
577 |
prompt = chat_prompt,
|
578 |
+
# memory = ss.memory,
|
579 |
input_key = "query",
|
580 |
output_key = "output_text",
|
581 |
verbose = True,
|