Thiloid commited on
Commit
ab0c31c
·
verified ·
1 Parent(s): 896ddda

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +6 -3
run.py CHANGED
@@ -87,12 +87,15 @@ client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
87
 
88
 
89
  def format_prompt(message, history):
90
- print("HOSTORY")
91
  print(history)
92
  prompt = "" #"<s>"
 
93
  for user_prompt, bot_response in history:
94
- prompt += f"[INST] {user_prompt} [/INST]"
95
- prompt += f" {bot_response}</s> "
 
 
96
  prompt += f"[INST] {message} [/INST]"
97
  print("Final P")
98
  print(prompt)
 
87
 
88
 
89
  def format_prompt(message, history):
90
+ print("HISTORY")
91
  print(history)
92
  prompt = "" #"<s>"
93
+ c=1
94
  for user_prompt, bot_response in history:
95
+ if c<2:
96
+ prompt += f"[INST] {user_prompt} [/INST]"
97
+ prompt += f" {bot_response}</s> "
98
+ c=c+1
99
  prompt += f"[INST] {message} [/INST]"
100
  print("Final P")
101
  print(prompt)