tberg99 commited on
Commit
0451453
Β·
verified Β·
1 Parent(s): 499e50d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -72,14 +72,14 @@ def prepare_prompt(prompt, chat_history):
72
 
73
  def apply_prompt_syntax(prompt, system_prompt, prompt_template, bake_in_prompt_syntax):
74
  model_family_syntax = {
75
- "llama3-instruct (llama-3 & 3.1) - system": """\n<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n{system_prompt}<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n{prompt}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n""",
76
- "llama3-instruct (llama-3 & 3.1) - user": """\n<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\n{prompt}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n""",
77
- "granite-13b-chat & instruct - system": """\n<|system|>\n{system_prompt}\n<|user|>\n{prompt}\n<|assistant|>\n\n""",
78
- "granite-13b-chat & instruct - user": """\n<|user|>\n{prompt}\n<|assistant|>\n\n""",
79
- "llama2-chat - system": """\n[INST] <<SYS>>\n{system_prompt}\n<</SYS>>\n\n{prompt} [/INST] """,
80
- "llama2-chat - user": """\n[INST] {prompt} [/INST] """,
81
- "mistral & mixtral v2 tokenizer - system": """\n<s>[INST] System Prompt:[{system_prompt}]\n\n{prompt} [/INST] """,
82
- "mistral & mixtral v2 tokenizer - user": """\n<s>[INST] {prompt} [/INST] """
83
  }
84
 
85
  if bake_in_prompt_syntax:
 
72
 
73
  def apply_prompt_syntax(prompt, system_prompt, prompt_template, bake_in_prompt_syntax):
74
  model_family_syntax = {
75
+ β€œllama3-instruct (llama-3, 3.1 & 3.2) - system”: β€œβ€"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n{system_prompt}<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n{prompt}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\nβ€β€œβ€,
76
+ β€œllama3-instruct (llama-3, 3.1 & 3.2) - user”: β€œβ€"<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\n{prompt}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\nβ€β€œβ€,
77
+ β€œgranite-13b-chat & instruct - system”: β€œβ€"<|system|>\n{system_prompt}\n<|user|>\n{prompt}\n<|assistant|>\n\nβ€β€œβ€,
78
+ β€œgranite-13b-chat & instruct - user”: β€œβ€"<|user|>\n{prompt}\n<|assistant|>\n\nβ€β€œβ€,
79
+ β€œmistral & mixtral v2 tokenizer - system”: β€œβ€"<s>[INST] System Prompt: {system_prompt} [/INST][INST] {prompt} [/INST]\n\nβ€β€œβ€,
80
+ β€œmistral & mixtral v2 tokenizer - user”: β€œβ€"<s>[INST] {prompt} [/INST]\n\nβ€β€œβ€,
81
+ β€œno syntax - system”: β€œβ€"{system_prompt}\n\n{prompt}β€œβ€",
82
+ β€œno syntax - user”: β€œβ€"{prompt}β€œβ€"
83
  }
84
 
85
  if bake_in_prompt_syntax: