Update app.py
Browse files
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 |
-
|
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):
|