Upload folder using huggingface_hub
Browse files- chat_template.jinja +15 -54
- config.json +19 -59
- generation_config.json +5 -12
- model.safetensors +2 -2
- tokenizer.json +2 -2
- tokenizer_config.json +40 -27
chat_template.jinja
CHANGED
|
@@ -1,54 +1,15 @@
|
|
| 1 |
-
{%
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
{%
|
| 15 |
-
|
| 16 |
-
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
| 17 |
-
{%- else %}
|
| 18 |
-
{{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
|
| 19 |
-
{%- endif %}
|
| 20 |
-
{%- endif %}
|
| 21 |
-
{%- for message in messages %}
|
| 22 |
-
{%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
|
| 23 |
-
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 24 |
-
{%- elif message.role == "assistant" %}
|
| 25 |
-
{{- '<|im_start|>' + message.role }}
|
| 26 |
-
{%- if message.content %}
|
| 27 |
-
{{- '\n' + message.content }}
|
| 28 |
-
{%- endif %}
|
| 29 |
-
{%- for tool_call in message.tool_calls %}
|
| 30 |
-
{%- if tool_call.function is defined %}
|
| 31 |
-
{%- set tool_call = tool_call.function %}
|
| 32 |
-
{%- endif %}
|
| 33 |
-
{{- '\n<tool_call>\n{"name": "' }}
|
| 34 |
-
{{- tool_call.name }}
|
| 35 |
-
{{- '", "arguments": ' }}
|
| 36 |
-
{{- tool_call.arguments | tojson }}
|
| 37 |
-
{{- '}\n</tool_call>' }}
|
| 38 |
-
{%- endfor %}
|
| 39 |
-
{{- '<|im_end|>\n' }}
|
| 40 |
-
{%- elif message.role == "tool" %}
|
| 41 |
-
{%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
|
| 42 |
-
{{- '<|im_start|>user' }}
|
| 43 |
-
{%- endif %}
|
| 44 |
-
{{- '\n<tool_response>\n' }}
|
| 45 |
-
{{- message.content }}
|
| 46 |
-
{{- '\n</tool_response>' }}
|
| 47 |
-
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 48 |
-
{{- '<|im_end|>\n' }}
|
| 49 |
-
{%- endif %}
|
| 50 |
-
{%- endif %}
|
| 51 |
-
{%- endfor %}
|
| 52 |
-
{%- if add_generation_prompt %}
|
| 53 |
-
{{- '<|im_start|>assistant\n' }}
|
| 54 |
-
{%- endif %}
|
|
|
|
| 1 |
+
{% for message in messages %}
|
| 2 |
+
{% if message['role'] == 'user' %}
|
| 3 |
+
{{ '<|user|>
|
| 4 |
+
' + message['content'] + eos_token }}
|
| 5 |
+
{% elif message['role'] == 'system' %}
|
| 6 |
+
{{ '<|system|>
|
| 7 |
+
' + message['content'] + eos_token }}
|
| 8 |
+
{% elif message['role'] == 'assistant' %}
|
| 9 |
+
{{ '<|assistant|>
|
| 10 |
+
' + message['content'] + eos_token }}
|
| 11 |
+
{% endif %}
|
| 12 |
+
{% if loop.last and add_generation_prompt %}
|
| 13 |
+
{{ '<|assistant|>' }}
|
| 14 |
+
{% endif %}
|
| 15 |
+
{% endfor %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
CHANGED
|
@@ -1,60 +1,24 @@
|
|
| 1 |
{
|
| 2 |
"architectures": [
|
| 3 |
-
"
|
| 4 |
],
|
|
|
|
| 5 |
"attention_dropout": 0.0,
|
| 6 |
-
"bos_token_id":
|
| 7 |
"dtype": "bfloat16",
|
| 8 |
-
"eos_token_id":
|
|
|
|
| 9 |
"hidden_act": "silu",
|
| 10 |
"hidden_size": 2048,
|
| 11 |
"initializer_range": 0.02,
|
| 12 |
-
"intermediate_size":
|
| 13 |
-
"
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
"full_attention",
|
| 21 |
-
"full_attention",
|
| 22 |
-
"full_attention",
|
| 23 |
-
"full_attention",
|
| 24 |
-
"full_attention",
|
| 25 |
-
"full_attention",
|
| 26 |
-
"full_attention",
|
| 27 |
-
"full_attention",
|
| 28 |
-
"full_attention",
|
| 29 |
-
"full_attention",
|
| 30 |
-
"full_attention",
|
| 31 |
-
"full_attention",
|
| 32 |
-
"full_attention",
|
| 33 |
-
"full_attention",
|
| 34 |
-
"full_attention",
|
| 35 |
-
"full_attention",
|
| 36 |
-
"full_attention",
|
| 37 |
-
"full_attention",
|
| 38 |
-
"full_attention",
|
| 39 |
-
"full_attention",
|
| 40 |
-
"full_attention",
|
| 41 |
-
"full_attention",
|
| 42 |
-
"full_attention",
|
| 43 |
-
"full_attention",
|
| 44 |
-
"full_attention",
|
| 45 |
-
"full_attention",
|
| 46 |
-
"full_attention",
|
| 47 |
-
"full_attention",
|
| 48 |
-
"full_attention",
|
| 49 |
-
"full_attention"
|
| 50 |
-
],
|
| 51 |
-
"max_position_embeddings": 32768,
|
| 52 |
-
"max_window_layers": 70,
|
| 53 |
-
"model_type": "qwen2",
|
| 54 |
-
"num_attention_heads": 16,
|
| 55 |
-
"num_hidden_layers": 36,
|
| 56 |
-
"num_key_value_heads": 2,
|
| 57 |
-
"pad_token_id": null,
|
| 58 |
"quantization_config": {
|
| 59 |
"config_groups": {
|
| 60 |
"group_0": {
|
|
@@ -92,15 +56,11 @@
|
|
| 92 |
"transform_config": {},
|
| 93 |
"version": "0.1.dev1+g9c3dd05"
|
| 94 |
},
|
| 95 |
-
"rms_norm_eps": 1e-
|
| 96 |
-
"
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
"sliding_window": null,
|
| 101 |
-
"tie_word_embeddings": true,
|
| 102 |
-
"transformers_version": "5.10.0.dev0",
|
| 103 |
"use_cache": true,
|
| 104 |
-
"
|
| 105 |
-
"vocab_size": 151936
|
| 106 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"architectures": [
|
| 3 |
+
"LlamaForCausalLM"
|
| 4 |
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 2,
|
| 10 |
+
"head_dim": 64,
|
| 11 |
"hidden_act": "silu",
|
| 12 |
"hidden_size": 2048,
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 5632,
|
| 15 |
+
"max_position_embeddings": 2048,
|
| 16 |
+
"mlp_bias": false,
|
| 17 |
+
"model_type": "llama",
|
| 18 |
+
"num_attention_heads": 32,
|
| 19 |
+
"num_hidden_layers": 22,
|
| 20 |
+
"num_key_value_heads": 4,
|
| 21 |
+
"pretraining_tp": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
"quantization_config": {
|
| 23 |
"config_groups": {
|
| 24 |
"group_0": {
|
|
|
|
| 56 |
"transform_config": {},
|
| 57 |
"version": "0.1.dev1+g9c3dd05"
|
| 58 |
},
|
| 59 |
+
"rms_norm_eps": 1e-05,
|
| 60 |
+
"rope_scaling": null,
|
| 61 |
+
"rope_theta": 10000.0,
|
| 62 |
+
"tie_word_embeddings": false,
|
| 63 |
+
"transformers_version": "4.57.6",
|
|
|
|
|
|
|
|
|
|
| 64 |
"use_cache": true,
|
| 65 |
+
"vocab_size": 32000
|
|
|
|
| 66 |
}
|
generation_config.json
CHANGED
|
@@ -1,14 +1,7 @@
|
|
| 1 |
{
|
| 2 |
-
"bos_token_id":
|
| 3 |
-
"
|
| 4 |
-
"
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
],
|
| 8 |
-
"pad_token_id": 151643,
|
| 9 |
-
"repetition_penalty": 1.05,
|
| 10 |
-
"temperature": 0.7,
|
| 11 |
-
"top_k": 20,
|
| 12 |
-
"top_p": 0.8,
|
| 13 |
-
"transformers_version": "5.10.0.dev0"
|
| 14 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"bos_token_id": 1,
|
| 3 |
+
"eos_token_id": 2,
|
| 4 |
+
"max_length": 2048,
|
| 5 |
+
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "4.57.6"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fd3cd03c5efd16ab6c61a03b9e4ad401c3373fee4a58c124a31d20f37f26d6d4
|
| 3 |
+
size 1231253484
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c88bda6bdd84543eadebdf4bd2ec325ae43b71a3ff1fead6a766562c00b29bd8
|
| 3 |
+
size 3619016
|
tokenizer_config.json
CHANGED
|
@@ -1,30 +1,43 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"
|
| 4 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
"clean_up_tokenization_spaces": false,
|
| 6 |
-
"eos_token": "<
|
| 7 |
-
"
|
| 8 |
-
"
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 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 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"add_bos_token": true,
|
| 3 |
+
"add_eos_token": false,
|
| 4 |
+
"add_prefix_space": null,
|
| 5 |
+
"added_tokens_decoder": {
|
| 6 |
+
"0": {
|
| 7 |
+
"content": "<unk>",
|
| 8 |
+
"lstrip": false,
|
| 9 |
+
"normalized": false,
|
| 10 |
+
"rstrip": false,
|
| 11 |
+
"single_word": false,
|
| 12 |
+
"special": true
|
| 13 |
+
},
|
| 14 |
+
"1": {
|
| 15 |
+
"content": "<s>",
|
| 16 |
+
"lstrip": false,
|
| 17 |
+
"normalized": false,
|
| 18 |
+
"rstrip": false,
|
| 19 |
+
"single_word": false,
|
| 20 |
+
"special": true
|
| 21 |
+
},
|
| 22 |
+
"2": {
|
| 23 |
+
"content": "</s>",
|
| 24 |
+
"lstrip": false,
|
| 25 |
+
"normalized": false,
|
| 26 |
+
"rstrip": false,
|
| 27 |
+
"single_word": false,
|
| 28 |
+
"special": true
|
| 29 |
+
}
|
| 30 |
+
},
|
| 31 |
+
"bos_token": "<s>",
|
| 32 |
"clean_up_tokenization_spaces": false,
|
| 33 |
+
"eos_token": "</s>",
|
| 34 |
+
"extra_special_tokens": {},
|
| 35 |
+
"legacy": false,
|
| 36 |
+
"model_max_length": 2048,
|
| 37 |
+
"pad_token": "</s>",
|
| 38 |
+
"padding_side": "right",
|
| 39 |
+
"sp_model_kwargs": {},
|
| 40 |
+
"tokenizer_class": "LlamaTokenizer",
|
| 41 |
+
"unk_token": "<unk>",
|
| 42 |
+
"use_default_system_prompt": false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
}
|