✔✔
Browse files- README.md +14 -0
- chat_template.jinja +139 -0
- config.json +60 -0
- generation_config.json +11 -0
- model.safetensors +3 -0
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer_config.json +0 -0
README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model:
|
| 3 |
+
- tencent/Hunyuan-0.5B-Instruct
|
| 4 |
+
tags:
|
| 5 |
+
- heretic
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
---
|
| 8 |
+
Heretic? Heretic!
|
| 9 |
+
|
| 10 |
+
Obedience: 11%, original: 31%
|
| 11 |
+
|
| 12 |
+
KL divergence: 0.03
|
| 13 |
+
|
| 14 |
+
GGUF: [yourGGUF/heretic_Hunyuan-0.5B-Instruct_GGUF](https://huggingface.co/yourGGUF/heretic_Hunyuan-0.5B-Instruct_GGUF)
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if not add_generation_prompt is defined %}
|
| 2 |
+
{%- set add_generation_prompt = false %}
|
| 3 |
+
{%- endif %}
|
| 4 |
+
{%- set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='', is_first_sp=true, is_first_user=true, is_last_user=false) %}
|
| 5 |
+
{%- for message in messages %}
|
| 6 |
+
{%- if message['role'] == 'system' %}
|
| 7 |
+
{%- if ns.is_first_sp %}
|
| 8 |
+
{%- set ns.system_prompt = ns.system_prompt + message['content'] %}
|
| 9 |
+
{%- set ns.is_first_sp = false %}
|
| 10 |
+
{%- else %}
|
| 11 |
+
{% set ns.system_prompt = ns.system_prompt + '
|
| 12 |
+
|
| 13 |
+
' + message['content'] %}
|
| 14 |
+
{%- endif %}
|
| 15 |
+
{%- endif %}
|
| 16 |
+
{%- endfor %}
|
| 17 |
+
{{- bos_token }}
|
| 18 |
+
{{- ns.system_prompt }}
|
| 19 |
+
{%- if tools %}
|
| 20 |
+
{%- if ns.system_prompt != '' %}
|
| 21 |
+
{{- '
|
| 22 |
+
|
| 23 |
+
# Tools
|
| 24 |
+
|
| 25 |
+
You may call one or more functions to assist with the user query.' }}
|
| 26 |
+
{%- else %}
|
| 27 |
+
{{- '# Tools
|
| 28 |
+
|
| 29 |
+
You may call one or more functions to assist with the user query.' }}
|
| 30 |
+
{%- endif %}
|
| 31 |
+
{{- '
|
| 32 |
+
|
| 33 |
+
You are provided with function signatures within <tools></tools> XML tags:' }}
|
| 34 |
+
{{- '
|
| 35 |
+
<tools>
|
| 36 |
+
' }}
|
| 37 |
+
{%- for tool in tools %}
|
| 38 |
+
{%- if loop.index0 > 1 %}
|
| 39 |
+
{{- '
|
| 40 |
+
' }}
|
| 41 |
+
{%- endif %}
|
| 42 |
+
{{- tool | tojson }}
|
| 43 |
+
{%- endfor %}
|
| 44 |
+
{{- '
|
| 45 |
+
</tools>
|
| 46 |
+
|
| 47 |
+
' }}
|
| 48 |
+
{{- 'For function call returns, you should first print <tool_calls>' }}
|
| 49 |
+
{{- 'For each function call, you should return object like:
|
| 50 |
+
' }}
|
| 51 |
+
{{- '<tool_call>function_name
|
| 52 |
+
```json
|
| 53 |
+
function_arguments_in_json_format
|
| 54 |
+
```</tool_call>' }}
|
| 55 |
+
{{- 'At the end of function call returns, you should print </tool_calls>' }}
|
| 56 |
+
{%- endif %}
|
| 57 |
+
{%- if ns.system_prompt != '' or tools %}
|
| 58 |
+
{{- '<|hy_place▁holder▁no▁3|>' }}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{%- for message in messages %}
|
| 61 |
+
{%- if message['role'] == 'user' %}
|
| 62 |
+
{%- set ns.is_tool = false %}
|
| 63 |
+
{%- set ns.is_first = false %}
|
| 64 |
+
{%- set ns.is_last_user = true %}
|
| 65 |
+
{{- '<|hy_User|>' + message['content'] + '<|hy_Assistant|>' }}
|
| 66 |
+
{%- endif %}
|
| 67 |
+
{%- if message['role'] == 'assistant' and message['tool_calls'] is defined and message['tool_calls'] is not none %}
|
| 68 |
+
{%- set ns.is_last_user = false %}
|
| 69 |
+
{%- if ns.is_tool %}
|
| 70 |
+
{{- '</tool_responses>' + '<|hy_Assistant|>' }}
|
| 71 |
+
{%- endif %}
|
| 72 |
+
{%- set ns.is_first = false %}
|
| 73 |
+
{%- set ns.is_tool = false %}
|
| 74 |
+
{%- set ns.is_output_first = true %}
|
| 75 |
+
{%- for tool in message['tool_calls'] %}
|
| 76 |
+
{%- set arguments = tool['function']['arguments'] %}
|
| 77 |
+
{%- if arguments is not string %}
|
| 78 |
+
{%- set arguments = arguments | tojson %}
|
| 79 |
+
{%- endif %}
|
| 80 |
+
{%- if not ns.is_first %}
|
| 81 |
+
{%- if message['content'] is none %}
|
| 82 |
+
{{- '<tool_calls><tool_call>' + tool['function']['name'] + '
|
| 83 |
+
' + '```json' + '
|
| 84 |
+
' + arguments + '
|
| 85 |
+
' + '```' + '</tool_call>' }}
|
| 86 |
+
{%- else %}
|
| 87 |
+
{{- message['content'] + '<tool_calls><tool_call>' + tool['function']['name'] + '
|
| 88 |
+
' + '```json' + '
|
| 89 |
+
' + arguments + '
|
| 90 |
+
' + '```' + '</tool_call>' }}
|
| 91 |
+
{%- endif %}
|
| 92 |
+
{%- set ns.is_first = true %}
|
| 93 |
+
{%- else %}
|
| 94 |
+
{{- '
|
| 95 |
+
' + '<tool_call>' + tool['function']['name'] + '
|
| 96 |
+
' + '```json' + '
|
| 97 |
+
' + arguments + '
|
| 98 |
+
' + '```' + '</tool_call>' }}
|
| 99 |
+
{%- endif %}
|
| 100 |
+
{%- endfor %}
|
| 101 |
+
{{- '</tool_calls>' + eos_token }}
|
| 102 |
+
{%- endif %}
|
| 103 |
+
{%- if message['role'] == 'assistant' and (message['tool_calls'] is not defined or message['tool_calls'] is none) %}
|
| 104 |
+
{%- set content = message['content'] %}
|
| 105 |
+
{%- if '<answer>' in content and not loop.last %}
|
| 106 |
+
{%- set content = content.split('<answer>')[-1].strip('</answer>').strip() %}
|
| 107 |
+
{%- endif %}
|
| 108 |
+
{%- set ns.is_last_user = false %}
|
| 109 |
+
{%- if ns.is_tool %}
|
| 110 |
+
{{- '</tool_responses>' + '<|hy_Assistant|>' + content + eos_token }}
|
| 111 |
+
{%- set ns.is_tool = false %}
|
| 112 |
+
{%- else %}
|
| 113 |
+
{{- content + eos_token }}
|
| 114 |
+
{%- endif %}
|
| 115 |
+
{%- endif %}
|
| 116 |
+
{%- if message['role'] == 'tool' %}
|
| 117 |
+
{%- set ns.is_last_user = false %}
|
| 118 |
+
{%- set ns.is_tool = true %}
|
| 119 |
+
{%- if ns.is_output_first %}
|
| 120 |
+
{{- '<|hy_User|>' + '<tool_responses><tool_response>' + message['content'] + '</tool_response>' }}
|
| 121 |
+
{%- set ns.is_output_first = false %}
|
| 122 |
+
{%- else %}
|
| 123 |
+
{{- '
|
| 124 |
+
<tool_response>' + message['content'] + '</tool_response>' }}
|
| 125 |
+
{%- endif %}
|
| 126 |
+
{%- endif %}
|
| 127 |
+
{%- endfor %}
|
| 128 |
+
{%- if ns.is_tool %}
|
| 129 |
+
{{- '</tool_responses>' + '<|hy_Assistant|>' }}
|
| 130 |
+
{%- endif %}
|
| 131 |
+
{%- if add_generation_prompt and not ns.is_last_user and not ns.is_tool %}
|
| 132 |
+
{{- '<|hy_Assistant|>' }}
|
| 133 |
+
{%- endif %}
|
| 134 |
+
{%- if enable_thinking is defined and not enable_thinking %}
|
| 135 |
+
{{- '<think>
|
| 136 |
+
|
| 137 |
+
</think>
|
| 138 |
+
' }}
|
| 139 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_classification_head": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"HunYuanDenseV1ForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"attention_head_dim": 128,
|
| 9 |
+
"bos_token_id": 1,
|
| 10 |
+
"cla_share_factor": 2,
|
| 11 |
+
"class_num": 0,
|
| 12 |
+
"dense_list": [
|
| 13 |
+
1024,
|
| 14 |
+
0
|
| 15 |
+
],
|
| 16 |
+
"dtype": "bfloat16",
|
| 17 |
+
"eos_token_id": 120020,
|
| 18 |
+
"head_dim": 128,
|
| 19 |
+
"hidden_act": "silu",
|
| 20 |
+
"hidden_size": 1024,
|
| 21 |
+
"im_end_id": 5,
|
| 22 |
+
"im_newline_id": 11,
|
| 23 |
+
"im_start_id": 4,
|
| 24 |
+
"initializer_range": 0.02,
|
| 25 |
+
"intermediate_size": 3584,
|
| 26 |
+
"mask_init_id": 12,
|
| 27 |
+
"max_position_embeddings": 262144,
|
| 28 |
+
"mlp_bias": false,
|
| 29 |
+
"model_type": "hunyuan_v1_dense",
|
| 30 |
+
"norm_type": "rms",
|
| 31 |
+
"num_attention_heads": 16,
|
| 32 |
+
"num_hidden_layers": 24,
|
| 33 |
+
"num_key_value_heads": 8,
|
| 34 |
+
"org_vocab_size": 120818,
|
| 35 |
+
"pad_id": 120002,
|
| 36 |
+
"pad_token_id": 120002,
|
| 37 |
+
"pool_type": "last",
|
| 38 |
+
"pretraining_tp": 1,
|
| 39 |
+
"rms_norm_eps": 1e-05,
|
| 40 |
+
"rope_scaling": {
|
| 41 |
+
"alpha": 1000.0,
|
| 42 |
+
"beta_fast": 32,
|
| 43 |
+
"beta_slow": 1,
|
| 44 |
+
"factor": 1.0,
|
| 45 |
+
"mscale": 1.0,
|
| 46 |
+
"mscale_all_dim": 1.0,
|
| 47 |
+
"type": "dynamic"
|
| 48 |
+
},
|
| 49 |
+
"rope_theta": 10000.0,
|
| 50 |
+
"sep_token_id": 120007,
|
| 51 |
+
"text_end_id": 7,
|
| 52 |
+
"text_start_id": 6,
|
| 53 |
+
"tie_word_embeddings": true,
|
| 54 |
+
"transformers_version": "4.57.2",
|
| 55 |
+
"use_cache": true,
|
| 56 |
+
"use_cla": false,
|
| 57 |
+
"use_qk_norm": true,
|
| 58 |
+
"use_rotary_pos_emb": true,
|
| 59 |
+
"vocab_size": 120818
|
| 60 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 120000,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": 120020,
|
| 5 |
+
"pad_token_id": 120002,
|
| 6 |
+
"repetition_penalty": 1.05,
|
| 7 |
+
"temperature": 0.7,
|
| 8 |
+
"top_k": 20,
|
| 9 |
+
"top_p": 0.8,
|
| 10 |
+
"transformers_version": "4.57.2"
|
| 11 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a3747ef2eb9d6e2370cc1cd596449dd7133bc1c1ae3c74829f379c6161c90fb6
|
| 3 |
+
size 1078050648
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<|hy_begin▁of▁sentence|>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "<|hy_place▁holder▁no▁2|>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "<|hy_▁pad▁|>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
}
|
| 23 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|