Tonic commited on
Commit
508a95c
1 Parent(s): fb44f24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -25,8 +25,7 @@ tokenizer.eos_token_id = eos_token_id
25
  model.config.eos_token_id = eos_token_id
26
 
27
  def format_prompt(user_message, system_message="You are YiTonic, an AI language model created by Tonic-AI. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and follow ethical guidelines and promote positive behavior."):
28
- prompt_dict = {"role": "user", "content": f"{user_message}{system_message}"}
29
- prompt = str(prompt_dict)
30
  return prompt
31
 
32
  def predict(message, system_message, max_new_tokens=4056, temperature=3.5, top_p=0.9, top_k=40, model_max_length = 32000, do_sample=False):
 
25
  model.config.eos_token_id = eos_token_id
26
 
27
  def format_prompt(user_message, system_message="You are YiTonic, an AI language model created by Tonic-AI. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and follow ethical guidelines and promote positive behavior."):
28
+ prompt = f"<|im_start|>assistant\n{system_message}<|im_end|>\n<|im_start|>\nuser\n{user_message}<|im_end|>\nassistant\n"
 
29
  return prompt
30
 
31
  def predict(message, system_message, max_new_tokens=4056, temperature=3.5, top_p=0.9, top_k=40, model_max_length = 32000, do_sample=False):