rainy69 commited on
Commit
8a903b0
·
verified ·
1 Parent(s): 02f3c8f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
main.py CHANGED
@@ -17,12 +17,13 @@ class Item(BaseModel):
17
  top_p: float = 0.15
18
  repetition_penalty: float = 1.0
19
 
 
20
  def format_prompt(message, history):
21
  prompt = "<s>"
22
  for user_prompt, bot_response in history:
23
  prompt += f"[INST] {user_prompt} [/INST]"
24
- prompt += f" {bot_response}</s> "
25
- prompt += f"[INST] {message} [/INST]"
26
  return prompt
27
 
28
  def generate(item: Item):
 
17
  top_p: float = 0.15
18
  repetition_penalty: float = 1.0
19
 
20
+ # <s> [INST] Instruction [/INST] Model answer</s> [INST] Follow-up instruction [/INST]
21
  def format_prompt(message, history):
22
  prompt = "<s>"
23
  for user_prompt, bot_response in history:
24
  prompt += f"[INST] {user_prompt} [/INST]"
25
+ prompt += f" {bot_response} "
26
+ prompt += f"</s>[INST] {message} [/INST]"
27
  return prompt
28
 
29
  def generate(item: Item):