LeiChen05 commited on
Commit
5865a51
·
verified ·
1 Parent(s): d7f0220

Upload folder using huggingface_hub

Browse files
chat_template.jinja CHANGED
@@ -1,29 +1,95 @@
1
- {%- set enable_thinking = false %}
2
- {%- set boxed_instruction = 'You are a multiple-choice question answering model for general knowledge topics. Topics may include sciences, humanities, and geography. Each question contains labeled answer options. The number of options may vary from 2 to 20. Possible option labels are uppercase Latin letters: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T.This is a single-best-answer exam task. Read the question and all provided options carefully. Choose exactly one option letter that appears in the prompt. Do not invent a new letter. First identify the option content that best answers the question, then map it back to its uppercase Latin option letter. Do not overthink.Use at most 3 concise English sentences before the final answer. Do not output the option text, multiple letters, or a bare letter. For example, “B” or “B.” is invalid. The answer must be written as a LaTeX \boxed{} expression.The absolute final line of your entire response must be exactly in this format, with no period or text after it: Final answer: \boxed{X} Replace X with the single uppercase option letter. Inside \boxed{}, output ONLY the letter: no spaces, no punctuation, no text.' %}
3
-
4
- {%- if messages[0].role == 'system' %}
5
- {{- '<|im_start|>system\n' + messages[0].content + '\n\n' + boxed_instruction + '<|im_end|>\n' }}
 
 
 
 
 
 
 
 
 
 
6
  {%- else %}
7
- {{- '<|im_start|>system\n' + boxed_instruction + '<|im_end|>\n' }}
 
 
 
 
8
  {%- endif %}
9
-
 
 
 
 
 
 
 
10
  {%- for message in messages %}
11
  {%- if message.content is string %}
12
  {%- set content = message.content %}
13
  {%- else %}
14
  {%- set content = '' %}
15
  {%- endif %}
16
-
17
  {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
18
  {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
19
  {%- elif message.role == "assistant" %}
20
- {{- '<|im_start|>' + message.role + '\n' + content.lstrip('\n') + '<|im_end|>\n' }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  {%- endif %}
22
  {%- endfor %}
23
-
24
  {%- if add_generation_prompt %}
25
  {{- '<|im_start|>assistant\n' }}
26
- {%- if not enable_thinking %}
27
  {{- '<think>\n\n</think>\n\n' }}
28
  {%- endif %}
29
  {%- endif %}
 
1
+ {%- set enable_thinking = true %}
2
+ {%- set boxed_instruction = 'Drop all explanations. You must output EXACTLY one final line containing only the answer inside \\boxed{...}. For multiple-choice, box ONLY the uppercase letter, e.g., \\boxed{B}. Never append any text, period, or newline after the box. Strict format: \\boxed{YOUR_ANSWER}' %}
3
+ {%- if tools %}
4
+ {{- '<|im_start|>system\n' }}
5
+ {%- if messages[0].role == 'system' %}
6
+ {{- messages[0].content + '\n\n' + boxed_instruction + '\n\n' }}
7
+ {%- else %}
8
+ {{- boxed_instruction + '\n\n' }}
9
+ {%- endif %}
10
+ {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
11
+ {%- for tool in tools %}
12
+ {{- "\n" }}
13
+ {{- tool | tojson }}
14
+ {%- endfor %}
15
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
16
  {%- else %}
17
+ {%- if messages[0].role == 'system' %}
18
+ {{- '<|im_start|>system\n' + messages[0].content + '\n\n' + boxed_instruction + '<|im_end|>\n' }}
19
+ {%- else %}
20
+ {{- '<|im_start|>system\n' + boxed_instruction + '<|im_end|>\n' }}
21
+ {%- endif %}
22
  {%- endif %}
23
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
24
+ {%- for message in messages[::-1] %}
25
+ {%- set index = (messages|length - 1) - loop.index0 %}
26
+ {%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
27
+ {%- set ns.multi_step_tool = false %}
28
+ {%- set ns.last_query_index = index %}
29
+ {%- endif %}
30
+ {%- endfor %}
31
  {%- for message in messages %}
32
  {%- if message.content is string %}
33
  {%- set content = message.content %}
34
  {%- else %}
35
  {%- set content = '' %}
36
  {%- endif %}
 
37
  {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
38
  {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
39
  {%- elif message.role == "assistant" %}
40
+ {%- set reasoning_content = '' %}
41
+ {%- if message.reasoning_content is string %}
42
+ {%- set reasoning_content = message.reasoning_content %}
43
+ {%- else %}
44
+ {%- if '</think>' in content %}
45
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
46
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
47
+ {%- endif %}
48
+ {%- endif %}
49
+ {%- if loop.index0 > ns.last_query_index %}
50
+ {%- if loop.last or (not loop.last and reasoning_content) %}
51
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
52
+ {%- else %}
53
+ {{- '<|im_start|>' + message.role + '\n' + content }}
54
+ {%- endif %}
55
+ {%- else %}
56
+ {{- '<|im_start|>' + message.role + '\n' + content }}
57
+ {%- endif %}
58
+ {%- if message.tool_calls %}
59
+ {%- for tool_call in message.tool_calls %}
60
+ {%- if (loop.first and content) or (not loop.first) %}
61
+ {{- '\n' }}
62
+ {%- endif %}
63
+ {%- if tool_call.function %}
64
+ {%- set tool_call = tool_call.function %}
65
+ {%- endif %}
66
+ {{- '<tool_call>\n{"name": "' }}
67
+ {{- tool_call.name }}
68
+ {{- '", "arguments": ' }}
69
+ {%- if tool_call.arguments is string %}
70
+ {{- tool_call.arguments }}
71
+ {%- else %}
72
+ {{- tool_call.arguments | tojson }}
73
+ {%- endif %}
74
+ {{- '}\n</tool_call>' }}
75
+ {%- endfor %}
76
+ {%- endif %}
77
+ {{- '<|im_end|>\n' }}
78
+ {%- elif message.role == "tool" %}
79
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
80
+ {{- '<|im_start|>user' }}
81
+ {%- endif %}
82
+ {{- '\n<tool_response>\n' }}
83
+ {{- content }}
84
+ {{- '\n</tool_response>' }}
85
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
86
+ {{- '<|im_end|>\n' }}
87
+ {%- endif %}
88
  {%- endif %}
89
  {%- endfor %}
 
90
  {%- if add_generation_prompt %}
91
  {{- '<|im_start|>assistant\n' }}
92
+ {%- if enable_thinking is defined and enable_thinking is false %}
93
  {{- '<think>\n\n</think>\n\n' }}
94
  {%- endif %}
95
  {%- endif %}
model-00001-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b0aa096dd3684ec593682b8693511c22a88bc990b73f559d04be8c1f12d27341
3
  size 1981418432
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:951d16b4867de55aeb799a6116d59aebbcf71ca03c93d3e4b93abb04eea994c9
3
  size 1981418432
model-00002-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2c51582dd9a237547f382a0c5b5548fae285630f1c5501ce0a5ed17fcad40610
3
  size 1459766976
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62462576cd1ea2c4990677eb3ea526347600bc47ab4c7e7a7b0cad7fd97b9478
3
  size 1459766976
tokenizer_config.json CHANGED
@@ -5,21 +5,6 @@
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": true,
24
  "local_files_only": false,
25
  "model_max_length": 131072,
 
5
  "clean_up_tokenization_spaces": false,
6
  "eos_token": "<|im_end|>",
7
  "errors": "replace",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  "is_local": true,
9
  "local_files_only": false,
10
  "model_max_length": 131072,