Francisco Zanartu commited on
Commit
97d1503
·
1 Parent(s): 11a765e

add delimiters

Browse files
Files changed (1) hide show
  1. utils/templates.py +22 -14
utils/templates.py CHANGED
@@ -5,13 +5,15 @@ Contains prompt templates to be used on app.py
5
  from langchain.prompts import PromptTemplate
6
 
7
  REACT = PromptTemplate.from_template(
8
- """You will receive a piece of misinformation related to climate change. Your task is to translate this misinformation into a climate change-related question that challenges the misinformation and prompts for factual investigation.
9
  For example, if the misinformation is: "Climate change isn't real because it's been cold this winter."
10
  The translated question could be: "How does winter weather in one location relate to the broader scientific consensus on climate change?"
11
  Be as specific as possible, ensuring the question directly addresses climate change and encourages factual investigation. You have access to the following tools:
12
 
13
  {tools}
14
-
 
 
15
  Use the following format:
16
 
17
  Question: the translated question challenging the misinformation and prompting for factual investigation
@@ -24,7 +26,7 @@ Thought: I now know the final answer
24
  Final Answer: provide a factual response to the original misinformation, limit your answer two sentences or less than 30 words. Be specific, prefer facts that contain numbers or are backed up by recognised institutions or climate experts to ensure credibility.
25
 
26
  Begin!
27
-
28
  Question: {input}
29
  Thought:{agent_scratchpad}"""
30
  )
@@ -47,38 +49,44 @@ You've identified a {fallacy}-based fallacy in the following misinformation:
47
 
48
  You also possess the following factual information: {factual_information}
49
  Remember to be concise and reply within 40 words or fewer.
 
50
  misinformation: {misinformation}
51
  response:
 
52
  """
53
  )
54
 
55
  SUMMARIZATION = PromptTemplate.from_template(
56
- """
57
  Paraphrase the following text in 30 words or fewer.
58
-
59
- TEXT: {text}
 
 
60
  """
61
  )
62
 
63
  CONCLUDING = PromptTemplate.from_template(
64
- """[Instruction]:
65
  1. Reinforce the following fact and provide complementary details, if relevant, to enhance understanding.
66
  2. The output should be simple text summarizing the information in 30 words or fewer.
67
-
68
- Fact:
69
- {fact}
 
70
  """
71
  )
72
 
73
  CONCLUDING_INCONTEXT = PromptTemplate.from_template(
74
- """[Instruction]:
75
  1. Reinforce the following fact and provide complementary details, if relevant, to enhance understanding.
76
  2. The output should be simple text summarizing the information in 30 words or fewer.
77
 
78
  Complementary details:
79
  {complementary_details}
80
-
81
- Fact:
82
- {fact}
 
83
  """
84
  )
 
5
  from langchain.prompts import PromptTemplate
6
 
7
  REACT = PromptTemplate.from_template(
8
+ """<s>[INST] You will receive a piece of misinformation related to climate change. Your task is to translate this misinformation into a climate change-related question that challenges the misinformation and prompts for factual investigation.
9
  For example, if the misinformation is: "Climate change isn't real because it's been cold this winter."
10
  The translated question could be: "How does winter weather in one location relate to the broader scientific consensus on climate change?"
11
  Be as specific as possible, ensuring the question directly addresses climate change and encourages factual investigation. You have access to the following tools:
12
 
13
  {tools}
14
+ [/INST]
15
+ </s>
16
+ [INST]
17
  Use the following format:
18
 
19
  Question: the translated question challenging the misinformation and prompting for factual investigation
 
26
  Final Answer: provide a factual response to the original misinformation, limit your answer two sentences or less than 30 words. Be specific, prefer facts that contain numbers or are backed up by recognised institutions or climate experts to ensure credibility.
27
 
28
  Begin!
29
+ [/INST]
30
  Question: {input}
31
  Thought:{agent_scratchpad}"""
32
  )
 
49
 
50
  You also possess the following factual information: {factual_information}
51
  Remember to be concise and reply within 40 words or fewer.
52
+ <<<
53
  misinformation: {misinformation}
54
  response:
55
+ >>>
56
  """
57
  )
58
 
59
  SUMMARIZATION = PromptTemplate.from_template(
60
+ """[INST]
61
  Paraphrase the following text in 30 words or fewer.
62
+ [/INST]
63
+ <<<
64
+ text: {text}
65
+ >>>
66
  """
67
  )
68
 
69
  CONCLUDING = PromptTemplate.from_template(
70
+ """[INST]
71
  1. Reinforce the following fact and provide complementary details, if relevant, to enhance understanding.
72
  2. The output should be simple text summarizing the information in 30 words or fewer.
73
+ [/INST]
74
+ <<<
75
+ Fact: {fact}
76
+ >>>
77
  """
78
  )
79
 
80
  CONCLUDING_INCONTEXT = PromptTemplate.from_template(
81
+ """[INST]
82
  1. Reinforce the following fact and provide complementary details, if relevant, to enhance understanding.
83
  2. The output should be simple text summarizing the information in 30 words or fewer.
84
 
85
  Complementary details:
86
  {complementary_details}
87
+ [/INST]
88
+ <<<
89
+ Fact: {fact}
90
+ >>>
91
  """
92
  )