Upload merged LoRA model
Browse files- chat_template.jinja +13 -11
- config.json +3 -17
- generation_config.json +13 -0
- model.safetensors +3 -0
chat_template.jinja
CHANGED
|
@@ -17,23 +17,27 @@
|
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
{%- for message in messages[::-1] %}
|
| 19 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
-
{%- if ns.multi_step_tool and message.role == "user" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 21 |
{%- set ns.multi_step_tool = false %}
|
| 22 |
{%- set ns.last_query_index = index %}
|
| 23 |
{%- endif %}
|
| 24 |
{%- endfor %}
|
| 25 |
{%- for message in messages %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 27 |
-
{{- '<|im_start|>' + message.role + '\n' +
|
| 28 |
{%- elif message.role == "assistant" %}
|
| 29 |
-
{%- set content = message.content %}
|
| 30 |
{%- set reasoning_content = '' %}
|
| 31 |
-
{%- if message.reasoning_content is
|
| 32 |
{%- set reasoning_content = message.reasoning_content %}
|
| 33 |
{%- else %}
|
| 34 |
-
{%- if '</think>' in
|
| 35 |
-
{%- set
|
| 36 |
-
{%- set
|
| 37 |
{%- endif %}
|
| 38 |
{%- endif %}
|
| 39 |
{%- if loop.index0 > ns.last_query_index %}
|
|
@@ -70,7 +74,7 @@
|
|
| 70 |
{{- '<|im_start|>user' }}
|
| 71 |
{%- endif %}
|
| 72 |
{{- '\n<tool_response>\n' }}
|
| 73 |
-
{{-
|
| 74 |
{{- '\n</tool_response>' }}
|
| 75 |
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 76 |
{{- '<|im_end|>\n' }}
|
|
@@ -81,7 +85,5 @@
|
|
| 81 |
{{- '<|im_start|>assistant\n' }}
|
| 82 |
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 83 |
{{- '<think>\n\n</think>\n\n' }}
|
| 84 |
-
{%- else %}
|
| 85 |
-
{{- '<think>\n\n' }}
|
| 86 |
{%- endif %}
|
| 87 |
-
{%- endif %}
|
|
|
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
{%- for message in messages[::-1] %}
|
| 19 |
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
+
{%- 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>')) %}
|
| 21 |
{%- set ns.multi_step_tool = false %}
|
| 22 |
{%- set ns.last_query_index = index %}
|
| 23 |
{%- endif %}
|
| 24 |
{%- endfor %}
|
| 25 |
{%- for message in messages %}
|
| 26 |
+
{%- if message.content is string %}
|
| 27 |
+
{%- set content = message.content %}
|
| 28 |
+
{%- else %}
|
| 29 |
+
{%- set content = '' %}
|
| 30 |
+
{%- endif %}
|
| 31 |
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 32 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 33 |
{%- elif message.role == "assistant" %}
|
|
|
|
| 34 |
{%- set reasoning_content = '' %}
|
| 35 |
+
{%- if message.reasoning_content is string %}
|
| 36 |
{%- set reasoning_content = message.reasoning_content %}
|
| 37 |
{%- else %}
|
| 38 |
+
{%- if '</think>' in content %}
|
| 39 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 40 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 41 |
{%- endif %}
|
| 42 |
{%- endif %}
|
| 43 |
{%- if loop.index0 > ns.last_query_index %}
|
|
|
|
| 74 |
{{- '<|im_start|>user' }}
|
| 75 |
{%- endif %}
|
| 76 |
{{- '\n<tool_response>\n' }}
|
| 77 |
+
{{- content }}
|
| 78 |
{{- '\n</tool_response>' }}
|
| 79 |
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 80 |
{{- '<|im_end|>\n' }}
|
|
|
|
| 85 |
{{- '<|im_start|>assistant\n' }}
|
| 86 |
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 87 |
{{- '<think>\n\n</think>\n\n' }}
|
|
|
|
|
|
|
| 88 |
{%- endif %}
|
| 89 |
+
{%- endif %}
|
config.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
|
|
|
| 7 |
"eos_token_id": 151645,
|
| 8 |
"head_dim": 128,
|
| 9 |
"hidden_act": "silu",
|
|
@@ -46,29 +47,14 @@
|
|
| 46 |
"num_attention_heads": 16,
|
| 47 |
"num_hidden_layers": 28,
|
| 48 |
"num_key_value_heads": 8,
|
| 49 |
-
"quantization_config": {
|
| 50 |
-
"_load_in_4bit": false,
|
| 51 |
-
"_load_in_8bit": true,
|
| 52 |
-
"bnb_4bit_compute_dtype": "float32",
|
| 53 |
-
"bnb_4bit_quant_storage": "uint8",
|
| 54 |
-
"bnb_4bit_quant_type": "fp4",
|
| 55 |
-
"bnb_4bit_use_double_quant": false,
|
| 56 |
-
"llm_int8_enable_fp32_cpu_offload": false,
|
| 57 |
-
"llm_int8_has_fp16_weight": false,
|
| 58 |
-
"llm_int8_skip_modules": null,
|
| 59 |
-
"llm_int8_threshold": 6.0,
|
| 60 |
-
"load_in_4bit": false,
|
| 61 |
-
"load_in_8bit": true,
|
| 62 |
-
"quant_method": "bitsandbytes"
|
| 63 |
-
},
|
| 64 |
"rms_norm_eps": 1e-06,
|
| 65 |
"rope_scaling": null,
|
| 66 |
"rope_theta": 1000000,
|
| 67 |
"sliding_window": null,
|
| 68 |
"tie_word_embeddings": true,
|
| 69 |
-
"torch_dtype": "
|
| 70 |
"transformers_version": "4.53.1",
|
| 71 |
-
"use_cache":
|
| 72 |
"use_sliding_window": false,
|
| 73 |
"vocab_size": 151936
|
| 74 |
}
|
|
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 151643,
|
| 8 |
"eos_token_id": 151645,
|
| 9 |
"head_dim": 128,
|
| 10 |
"hidden_act": "silu",
|
|
|
|
| 47 |
"num_attention_heads": 16,
|
| 48 |
"num_hidden_layers": 28,
|
| 49 |
"num_key_value_heads": 8,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
"rms_norm_eps": 1e-06,
|
| 51 |
"rope_scaling": null,
|
| 52 |
"rope_theta": 1000000,
|
| 53 |
"sliding_window": null,
|
| 54 |
"tie_word_embeddings": true,
|
| 55 |
+
"torch_dtype": "float16",
|
| 56 |
"transformers_version": "4.53.1",
|
| 57 |
+
"use_cache": true,
|
| 58 |
"use_sliding_window": false,
|
| 59 |
"vocab_size": 151936
|
| 60 |
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 151643,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
151645,
|
| 6 |
+
151643
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 151643,
|
| 9 |
+
"temperature": 0.6,
|
| 10 |
+
"top_k": 20,
|
| 11 |
+
"top_p": 0.95,
|
| 12 |
+
"transformers_version": "4.53.1"
|
| 13 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:194225cedf09c00ff71c462c7b0547a74806c69071d68113c7f5c948353e5228
|
| 3 |
+
size 1192134784
|