nikravan commited on
Commit
51f57d5
·
verified ·
1 Parent(s): 1ac0be0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -55,12 +55,12 @@ latex_delimiters_set = [{
55
  def predict(message, history, system_prompt, temperature, max_new_tokens, top_k, repetition_penalty, top_p):
56
  # Format history with a given chat template
57
 
58
- stop_tokens = [tokenizer.eos_token_id]
59
- tokenizer.pad_token_id=151643
60
- instruction = system_prompt + "\n\n"
61
  for user, assistant in history:
62
- instruction += f"<|User|>{user}<|Assistant|>{assistant}\n"
63
- instruction += f"<|User|>{message}<|Assistant|>"
64
 
65
  print(instruction)
66
 
 
55
  def predict(message, history, system_prompt, temperature, max_new_tokens, top_k, repetition_penalty, top_p):
56
  # Format history with a given chat template
57
 
58
+
59
+ stop_tokens = ["<|endoftext|>", "<|im_end|>"]
60
+ instruction = '<|im_start|>system\n' + system_prompt + '\n<|im_end|>\n'
61
  for user, assistant in history:
62
+ instruction += f'<|im_start|>user\n{user}\n<|im_end|>\n<|im_start|>assistant\n{assistant}\n<|im_end|>\n'
63
+ instruction += f'<|im_start|>user\n{message}\n<|im_end|>\n<|im_start|>assistant\n'
64
 
65
  print(instruction)
66