ErenOzilgili commited on
Commit
25ffbe2
·
verified ·
1 Parent(s): 8fc33c8

Upload folder using huggingface_hub

Browse files
.ipynb_checkpoints/chat_template-checkpoint.jinja ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}
2
+ {% if not enable_thinking is defined %}{% set enable_thinking = true %}{% endif %}
3
+ {% set forced_system_prompt = 'You are a helpful assistant expert in mathematics. Please reason step by step inside the reasoning block. Break down complex equations, carefully verify your arithmetic at each step, and actively look for edge cases or alternative solution paths. Crucially, simplify your final mathematical results completely into their most reduced or standard form whenever possible. Once you have thoroughly double-checked your work, place this final simplified result strictly within \\boxed{}.' %}
4
+
5
+ {% if messages[0]['role'] != 'system' %}
6
+ {{ '<|im_start|>system\n' + forced_system_prompt + '<|im_end|>\n' }}
7
+ {% endif %}
8
+
9
+ {% for message in messages %}
10
+ {{ '<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>\n' }}
11
+ {% endfor %}
12
+
13
+ {% if add_generation_prompt %}
14
+ {% if enable_thinking %}
15
+ {{ '<|im_start|>assistant\n<think>\n' }}
16
+ {% else %}
17
+ {{ '<|im_start|>assistant\n' }}
18
+ {% endif %}
19
+ {% endif %}
.ipynb_checkpoints/tokenizer_config-checkpoint.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|endoftext|>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>",
11
+ "<|object_ref_start|>",
12
+ "<|object_ref_end|>",
13
+ "<|box_start|>",
14
+ "<|box_end|>",
15
+ "<|quad_start|>",
16
+ "<|quad_end|>",
17
+ "<|vision_start|>",
18
+ "<|vision_end|>",
19
+ "<|vision_pad|>",
20
+ "<|image_pad|>",
21
+ "<|video_pad|>"
22
+ ],
23
+ "is_local": false,
24
+ "local_files_only": false,
25
+ "model_max_length": 131072,
26
+ "pad_token": "<|endoftext|>",
27
+ "split_special_tokens": false,
28
+ "tokenizer_class": "Qwen2Tokenizer",
29
+ "unk_token": null
30
+ }
chat_template.jinja CHANGED
@@ -1,19 +1,23 @@
1
- {% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}
2
- {% if not enable_thinking is defined %}{% set enable_thinking = true %}{% endif %}
3
- {% set forced_system_prompt = 'You are a helpful assistant expert in mathematics. Please reason step by step inside the reasoning block. Break down complex equations, carefully verify your arithmetic at each step, and actively look for edge cases or alternative solution paths. Crucially, simplify your final mathematical results completely into their most reduced or standard form whenever possible. Once you have thoroughly double-checked your work, place this final simplified result strictly within \\boxed{}.' %}
4
 
5
- {% if messages[0]['role'] != 'system' %}
6
- {{ '<|im_start|>system\n' + forced_system_prompt + '<|im_end|>\n' }}
7
- {% endif %}
 
 
8
 
9
- {% for message in messages %}
10
- {{ '<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>\n' }}
11
- {% endfor %}
 
 
12
 
13
- {% if add_generation_prompt %}
14
- {% if enable_thinking %}
15
- {{ '<|im_start|>assistant\n<think>\n' }}
16
- {% else %}
17
- {{ '<|im_start|>assistant\n' }}
18
- {% endif %}
19
- {% endif %}
 
1
+ {%- if not add_generation_prompt is defined -%}{%- set add_generation_prompt = false -%}{%- endif -%}
2
+ {%- if not enable_thinking is defined -%}{%- set enable_thinking = true -%}{%- endif -%}
3
+ {%- set forced_system_prompt = 'You are a helpful assistant expert in mathematics. Please reason step by step inside the reasoning block. Break down complex equations, carefully verify your arithmetic at each step, and actively look for edge cases or alternative solution paths. Crucially, simplify your final mathematical results completely into their most reduced or standard form whenever possible. Once you have thoroughly double-checked your work, place this final simplified result strictly within \\boxed{}.' -%}
4
 
5
+ {#- 1. Inject forced system prompt if not present -#}
6
+ {%- if messages[0]['role'] != 'system' -%}
7
+ <|im_start|>system
8
+ {{ forced_system_prompt }}<|im_end|>
9
+ {% endif -%}
10
 
11
+ {#- 2. Loop through normal user/assistant message history -#}
12
+ {%- for message in messages -%}
13
+ <|im_start|>{{ message['role'] }}
14
+ {{ message['content'] }}<|im_end|>
15
+ {% endfor -%}
16
 
17
+ {#- 3. Handle generation prompt based on the thinking toggle flag -#}
18
+ {%- if add_generation_prompt -%}
19
+ <|im_start|>assistant
20
+ {% if enable_thinking -%}
21
+ <think>
22
+ {% endif -%}
23
+ {%- endif -%}