Arturo Jiménez de los Galanes Reguillos commited on
Commit
005c893
1 Parent(s): 25de67e

Restore chat template

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -5,7 +5,7 @@ from threading import Thread
5
  import torch
6
 
7
  MODEL = "m-a-p/OpenCodeInterpreter-DS-33B"
8
- CHAT_TEMPLATE = "{%- set found_item = false -%}\n{%- for message in messages -%}\n {%- if message['role'] == 'system' -%}\n {%- set found_item = true -%}\n {%- endif -%}\n{%- endfor -%}\n{%- if not found_item -%}\n{{'You are an AI programming assistant, utilizing the Deepseek Coder model, developed by Deepseek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer.\\n'}}\n{%- endif %}\n{%- for message in messages %}\n {%- if message['role'] == 'system' %}\n{{ message['content'] }}\n {%- else %}\n {%- if message['role'] == 'user' %}\n{{'### Instruction:\\n' + message['content'] + '\\n'}}\n {%- else %}\n{{'### Response:\\n' + message['content'] + '\\n<|EOT|>\\n'}}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{{'### Response:\\n'}}\n"
9
 
10
  system_message = "You are a computer programmer that can translate python code to C++ in order to improve performance"
11
 
 
5
  import torch
6
 
7
  MODEL = "m-a-p/OpenCodeInterpreter-DS-33B"
8
+ CHAT_TEMPLATE = "{% for message in messages %}\n{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}\n{% endfor %}\n{% if add_generation_prompt %}\n{{ '<|im_start|>assistant\n' }}\n{% endif %}"
9
 
10
  system_message = "You are a computer programmer that can translate python code to C++ in order to improve performance"
11