forked from nlpxucan/WizardLM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepth.py
34 lines (28 loc) · 2.05 KB
/
depth.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
base_instruction = "I want you act as a Prompt Rewriter.\r\n \
Your objective is to rewrite a given prompt into a more complex version to make those famous AI systems (e.g., chatgpt and GPT4) a bit harder to handle.\r\n \
But the rewritten prompt must be reasonable and must be understood and responded by humans.\r\n \
Your rewriting cannot omit the non-text parts such as the table and code in #The Given Prompt#:. Also, please do not omit the input in #The Given Prompt#. \r\n \
You SHOULD complicate the given prompt using the following method: \r\n\
{} \r\n\
You should try your best not to make the #Rewritten Prompt# become verbose, #Rewritten Prompt# can only add 10 to 20 words into #The Given Prompt#. \r\n\
'#The Given Prompt#', '#Rewritten Prompt#', 'given prompt' and 'rewritten prompt' are not allowed to appear in #Rewritten Prompt#\r\n"
def createConstraintsPrompt(instruction):
prompt = base_instruction.format("Please add one more constraints/requirements into #The Given Prompt#'")
prompt += "#The Given Prompt#: \r\n {} \r\n".format(instruction)
prompt += "#Rewritten Prompt#:\r\n"
return prompt
def createDeepenPrompt(instruction):
prompt = base_instruction.format("If #The Given Prompt# contains inquiries about certain issues, the depth and breadth of the inquiry can be increased.")
prompt += "#The Given Prompt#: \r\n {} \r\n".format(instruction)
prompt += "#Rewritten Prompt#:\r\n"
return prompt
def createConcretizingPrompt(instruction):
prompt = base_instruction.format("Please replace general concepts with more specific concepts.")
prompt += "#The Given Prompt#: \r\n {} \r\n".format(instruction)
prompt += "#Rewritten Prompt#:\r\n"
return prompt
def createReasoningPrompt(instruction):
prompt = base_instruction.format("If #The Given Prompt# can be solved with just a few simple thinking processes, you can rewrite it to explicitly request multiple-step reasoning.")
prompt += "#The Given Prompt#: \r\n {} \r\n".format(instruction)
prompt += "#Rewritten Prompt#:\r\n"
return prompt