cawacci commited on
Commit
ee76be7
โ€ข
1 Parent(s): 1e15c40

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
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
- 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_common_format = """
345
  ===
346
  [Question] {query}
347
  [references] {context}
348
- [Summary] """
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,