初始化项目,由ModelHub XC社区提供模型
Model: cs-552-2026-the-transformers/safety_model Source: Original Platform
This commit is contained in:
89
checkpoint-189/chat_template.jinja
Normal file
89
checkpoint-189/chat_template.jinja
Normal file
@@ -0,0 +1,89 @@
|
||||
{%- if tools %}
|
||||
{{- '<|im_start|>system\n' }}
|
||||
{%- if messages[0].role == 'system' %}
|
||||
{{- messages[0].content + '\n\n' }}
|
||||
{%- endif %}
|
||||
{{- "# 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>" }}
|
||||
{%- for tool in tools %}
|
||||
{{- "\n" }}
|
||||
{{- tool | tojson }}
|
||||
{%- endfor %}
|
||||
{{- "\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" }}
|
||||
{%- else %}
|
||||
{%- if messages[0].role == 'system' %}
|
||||
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
||||
{%- for message in messages[::-1] %}
|
||||
{%- set index = (messages|length - 1) - loop.index0 %}
|
||||
{%- 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>')) %}
|
||||
{%- set ns.multi_step_tool = false %}
|
||||
{%- set ns.last_query_index = index %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- for message in messages %}
|
||||
{%- if message.content is string %}
|
||||
{%- set content = message.content %}
|
||||
{%- else %}
|
||||
{%- set content = '' %}
|
||||
{%- endif %}
|
||||
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
||||
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
||||
{%- elif message.role == "assistant" %}
|
||||
{%- set reasoning_content = '' %}
|
||||
{%- if message.reasoning_content is string %}
|
||||
{%- set reasoning_content = message.reasoning_content %}
|
||||
{%- else %}
|
||||
{%- if '</think>' in content %}
|
||||
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
||||
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- if loop.index0 > ns.last_query_index %}
|
||||
{%- if loop.last or (not loop.last and reasoning_content) %}
|
||||
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
||||
{%- else %}
|
||||
{{- '<|im_start|>' + message.role + '\n' + content }}
|
||||
{%- endif %}
|
||||
{%- else %}
|
||||
{{- '<|im_start|>' + message.role + '\n' + content }}
|
||||
{%- endif %}
|
||||
{%- if message.tool_calls %}
|
||||
{%- for tool_call in message.tool_calls %}
|
||||
{%- if (loop.first and content) or (not loop.first) %}
|
||||
{{- '\n' }}
|
||||
{%- endif %}
|
||||
{%- if tool_call.function %}
|
||||
{%- set tool_call = tool_call.function %}
|
||||
{%- endif %}
|
||||
{{- '<tool_call>\n{"name": "' }}
|
||||
{{- tool_call.name }}
|
||||
{{- '", "arguments": ' }}
|
||||
{%- if tool_call.arguments is string %}
|
||||
{{- tool_call.arguments }}
|
||||
{%- else %}
|
||||
{{- tool_call.arguments | tojson }}
|
||||
{%- endif %}
|
||||
{{- '}\n</tool_call>' }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{{- '<|im_end|>\n' }}
|
||||
{%- elif message.role == "tool" %}
|
||||
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
||||
{{- '<|im_start|>user' }}
|
||||
{%- endif %}
|
||||
{{- '\n<tool_response>\n' }}
|
||||
{{- content }}
|
||||
{{- '\n</tool_response>' }}
|
||||
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
||||
{{- '<|im_end|>\n' }}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- if add_generation_prompt %}
|
||||
{{- '<|im_start|>assistant\n' }}
|
||||
{%- if enable_thinking is defined and enable_thinking is false %}
|
||||
{{- '<think>\n\n</think>\n\n' }}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
63
checkpoint-189/config.json
Normal file
63
checkpoint-189/config.json
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"architectures": [
|
||||
"Qwen3ForCausalLM"
|
||||
],
|
||||
"attention_bias": false,
|
||||
"attention_dropout": 0.0,
|
||||
"bos_token_id": null,
|
||||
"dtype": "bfloat16",
|
||||
"eos_token_id": 151645,
|
||||
"head_dim": 128,
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 2048,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 6144,
|
||||
"layer_types": [
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention"
|
||||
],
|
||||
"max_position_embeddings": 40960,
|
||||
"max_window_layers": 28,
|
||||
"model_type": "qwen3",
|
||||
"num_attention_heads": 16,
|
||||
"num_hidden_layers": 28,
|
||||
"num_key_value_heads": 8,
|
||||
"pad_token_id": 151643,
|
||||
"rms_norm_eps": 1e-06,
|
||||
"rope_parameters": {
|
||||
"rope_theta": 1000000,
|
||||
"rope_type": "default"
|
||||
},
|
||||
"sliding_window": null,
|
||||
"tie_word_embeddings": true,
|
||||
"transformers_version": "5.7.0",
|
||||
"use_cache": false,
|
||||
"use_sliding_window": false,
|
||||
"vocab_size": 151936
|
||||
}
|
||||
12
checkpoint-189/generation_config.json
Normal file
12
checkpoint-189/generation_config.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"do_sample": true,
|
||||
"eos_token_id": [
|
||||
151645,
|
||||
151643
|
||||
],
|
||||
"pad_token_id": 151643,
|
||||
"temperature": 0.6,
|
||||
"top_k": 20,
|
||||
"top_p": 0.95,
|
||||
"transformers_version": "5.7.0"
|
||||
}
|
||||
3
checkpoint-189/model.safetensors
Normal file
3
checkpoint-189/model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:901f734b20929e6d89aa77c20ce5eba58304d4594b4a3cdbb5d0b63462300ce2
|
||||
size 3441185608
|
||||
3
checkpoint-189/optimizer.pt
Normal file
3
checkpoint-189/optimizer.pt
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4e7da65283d99ce5cf7edfabd85835029bfd04f12378dba203bd16b429133eeb
|
||||
size 6882572207
|
||||
3
checkpoint-189/rng_state.pth
Normal file
3
checkpoint-189/rng_state.pth
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:61c19bab1174704a4a4441475683bf1270277af15d2e2c95e964789128e482c4
|
||||
size 14645
|
||||
3
checkpoint-189/scheduler.pt
Normal file
3
checkpoint-189/scheduler.pt
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:aead4b343e2bf68c616057b87b8e51106ac2226e0139a6361df37f62d53abeb3
|
||||
size 1465
|
||||
3
checkpoint-189/tokenizer.json
Normal file
3
checkpoint-189/tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
|
||||
size 11422650
|
||||
30
checkpoint-189/tokenizer_config.json
Normal file
30
checkpoint-189/tokenizer_config.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"add_prefix_space": false,
|
||||
"backend": "tokenizers",
|
||||
"bos_token": null,
|
||||
"clean_up_tokenization_spaces": false,
|
||||
"eos_token": "<|im_end|>",
|
||||
"errors": "replace",
|
||||
"extra_special_tokens": [
|
||||
"<|im_start|>",
|
||||
"<|im_end|>",
|
||||
"<|object_ref_start|>",
|
||||
"<|object_ref_end|>",
|
||||
"<|box_start|>",
|
||||
"<|box_end|>",
|
||||
"<|quad_start|>",
|
||||
"<|quad_end|>",
|
||||
"<|vision_start|>",
|
||||
"<|vision_end|>",
|
||||
"<|vision_pad|>",
|
||||
"<|image_pad|>",
|
||||
"<|video_pad|>"
|
||||
],
|
||||
"is_local": false,
|
||||
"local_files_only": false,
|
||||
"model_max_length": 131072,
|
||||
"pad_token": "<|endoftext|>",
|
||||
"split_special_tokens": false,
|
||||
"tokenizer_class": "Qwen2Tokenizer",
|
||||
"unk_token": null
|
||||
}
|
||||
214
checkpoint-189/trainer_state.json
Normal file
214
checkpoint-189/trainer_state.json
Normal file
@@ -0,0 +1,214 @@
|
||||
{
|
||||
"best_global_step": null,
|
||||
"best_metric": null,
|
||||
"best_model_checkpoint": null,
|
||||
"epoch": 1.0,
|
||||
"eval_steps": 500,
|
||||
"global_step": 189,
|
||||
"is_hyper_param_search": false,
|
||||
"is_local_process_zero": true,
|
||||
"is_world_process_zero": true,
|
||||
"log_history": [
|
||||
{
|
||||
"entropy": 0.9081946484744549,
|
||||
"epoch": 0.053015241882041084,
|
||||
"grad_norm": 51.5,
|
||||
"learning_rate": 3e-06,
|
||||
"loss": 2.320839500427246,
|
||||
"mean_token_accuracy": 0.5708254482597113,
|
||||
"num_tokens": 30761.0,
|
||||
"step": 10
|
||||
},
|
||||
{
|
||||
"entropy": 1.032745758444071,
|
||||
"epoch": 0.10603048376408217,
|
||||
"grad_norm": 21.125,
|
||||
"learning_rate": 6.333333333333333e-06,
|
||||
"loss": 1.9631355285644532,
|
||||
"mean_token_accuracy": 0.5809337079524994,
|
||||
"num_tokens": 61277.0,
|
||||
"step": 20
|
||||
},
|
||||
{
|
||||
"entropy": 1.2370933540165425,
|
||||
"epoch": 0.15904572564612326,
|
||||
"grad_norm": 11.0625,
|
||||
"learning_rate": 9.666666666666667e-06,
|
||||
"loss": 1.4653306961059571,
|
||||
"mean_token_accuracy": 0.6311864696443081,
|
||||
"num_tokens": 91730.0,
|
||||
"step": 30
|
||||
},
|
||||
{
|
||||
"entropy": 1.1646109029650689,
|
||||
"epoch": 0.21206096752816433,
|
||||
"grad_norm": 8.5625,
|
||||
"learning_rate": 1.3000000000000001e-05,
|
||||
"loss": 1.200753402709961,
|
||||
"mean_token_accuracy": 0.6730783767998219,
|
||||
"num_tokens": 122896.0,
|
||||
"step": 40
|
||||
},
|
||||
{
|
||||
"entropy": 1.0138436160981654,
|
||||
"epoch": 0.26507620941020543,
|
||||
"grad_norm": 7.4375,
|
||||
"learning_rate": 1.6333333333333335e-05,
|
||||
"loss": 1.0109354972839355,
|
||||
"mean_token_accuracy": 0.7080431424081326,
|
||||
"num_tokens": 153323.0,
|
||||
"step": 50
|
||||
},
|
||||
{
|
||||
"entropy": 0.8669569574296474,
|
||||
"epoch": 0.31809145129224653,
|
||||
"grad_norm": 6.75,
|
||||
"learning_rate": 1.9666666666666666e-05,
|
||||
"loss": 0.8859419822692871,
|
||||
"mean_token_accuracy": 0.7356305047869682,
|
||||
"num_tokens": 183928.0,
|
||||
"step": 60
|
||||
},
|
||||
{
|
||||
"entropy": 0.856675973534584,
|
||||
"epoch": 0.3711066931742876,
|
||||
"grad_norm": 7.6875,
|
||||
"learning_rate": 1.9666666666666666e-05,
|
||||
"loss": 0.8721119880676269,
|
||||
"mean_token_accuracy": 0.7318881675601006,
|
||||
"num_tokens": 215054.0,
|
||||
"step": 70
|
||||
},
|
||||
{
|
||||
"entropy": 0.7872001446783543,
|
||||
"epoch": 0.42412193505632867,
|
||||
"grad_norm": 7.46875,
|
||||
"learning_rate": 1.92962962962963e-05,
|
||||
"loss": 0.7920477390289307,
|
||||
"mean_token_accuracy": 0.7553018122911453,
|
||||
"num_tokens": 245614.0,
|
||||
"step": 80
|
||||
},
|
||||
{
|
||||
"entropy": 0.7739131577312947,
|
||||
"epoch": 0.47713717693836977,
|
||||
"grad_norm": 7.09375,
|
||||
"learning_rate": 1.8925925925925928e-05,
|
||||
"loss": 0.7949441432952881,
|
||||
"mean_token_accuracy": 0.7514781631529331,
|
||||
"num_tokens": 276651.0,
|
||||
"step": 90
|
||||
},
|
||||
{
|
||||
"entropy": 0.7763891488313674,
|
||||
"epoch": 0.5301524188204109,
|
||||
"grad_norm": 7.8125,
|
||||
"learning_rate": 1.8555555555555557e-05,
|
||||
"loss": 0.7867375373840332,
|
||||
"mean_token_accuracy": 0.7523738898336887,
|
||||
"num_tokens": 308561.0,
|
||||
"step": 100
|
||||
},
|
||||
{
|
||||
"entropy": 0.7757978036999702,
|
||||
"epoch": 0.583167660702452,
|
||||
"grad_norm": 7.21875,
|
||||
"learning_rate": 1.8185185185185186e-05,
|
||||
"loss": 0.7776416301727295,
|
||||
"mean_token_accuracy": 0.7548527352511882,
|
||||
"num_tokens": 339537.0,
|
||||
"step": 110
|
||||
},
|
||||
{
|
||||
"entropy": 0.7528716944158077,
|
||||
"epoch": 0.6361829025844931,
|
||||
"grad_norm": 6.28125,
|
||||
"learning_rate": 1.7814814814814815e-05,
|
||||
"loss": 0.7566296100616455,
|
||||
"mean_token_accuracy": 0.7637521453201771,
|
||||
"num_tokens": 370938.0,
|
||||
"step": 120
|
||||
},
|
||||
{
|
||||
"entropy": 0.7483146995306015,
|
||||
"epoch": 0.6891981444665342,
|
||||
"grad_norm": 7.0,
|
||||
"learning_rate": 1.7444444444444448e-05,
|
||||
"loss": 0.7508650302886963,
|
||||
"mean_token_accuracy": 0.758705198019743,
|
||||
"num_tokens": 402708.0,
|
||||
"step": 130
|
||||
},
|
||||
{
|
||||
"entropy": 0.7206243231892586,
|
||||
"epoch": 0.7422133863485753,
|
||||
"grad_norm": 6.65625,
|
||||
"learning_rate": 1.7074074074074077e-05,
|
||||
"loss": 0.7531259536743165,
|
||||
"mean_token_accuracy": 0.7641572073101998,
|
||||
"num_tokens": 433645.0,
|
||||
"step": 140
|
||||
},
|
||||
{
|
||||
"entropy": 0.7596748031675815,
|
||||
"epoch": 0.7952286282306164,
|
||||
"grad_norm": 6.03125,
|
||||
"learning_rate": 1.6703703703703703e-05,
|
||||
"loss": 0.7591583728790283,
|
||||
"mean_token_accuracy": 0.7570627965033054,
|
||||
"num_tokens": 465791.0,
|
||||
"step": 150
|
||||
},
|
||||
{
|
||||
"entropy": 0.7133973561227321,
|
||||
"epoch": 0.8482438701126573,
|
||||
"grad_norm": 7.125,
|
||||
"learning_rate": 1.6333333333333335e-05,
|
||||
"loss": 0.7458220005035401,
|
||||
"mean_token_accuracy": 0.7626615799963474,
|
||||
"num_tokens": 497296.0,
|
||||
"step": 160
|
||||
},
|
||||
{
|
||||
"entropy": 0.7134327009320259,
|
||||
"epoch": 0.9012591119946984,
|
||||
"grad_norm": 7.0,
|
||||
"learning_rate": 1.5962962962962964e-05,
|
||||
"loss": 0.7290266990661621,
|
||||
"mean_token_accuracy": 0.7681502625346184,
|
||||
"num_tokens": 528181.0,
|
||||
"step": 170
|
||||
},
|
||||
{
|
||||
"entropy": 0.7324420973658562,
|
||||
"epoch": 0.9542743538767395,
|
||||
"grad_norm": 7.5,
|
||||
"learning_rate": 1.5592592592592593e-05,
|
||||
"loss": 0.731742525100708,
|
||||
"mean_token_accuracy": 0.7631207950413227,
|
||||
"num_tokens": 558915.0,
|
||||
"step": 180
|
||||
}
|
||||
],
|
||||
"logging_steps": 10,
|
||||
"max_steps": 600,
|
||||
"num_input_tokens_seen": 0,
|
||||
"num_train_epochs": 4,
|
||||
"save_steps": 500,
|
||||
"stateful_callbacks": {
|
||||
"TrainerControl": {
|
||||
"args": {
|
||||
"should_epoch_stop": false,
|
||||
"should_evaluate": false,
|
||||
"should_log": false,
|
||||
"should_save": true,
|
||||
"should_training_stop": false
|
||||
},
|
||||
"attributes": {}
|
||||
}
|
||||
},
|
||||
"total_flos": 5671984696049664.0,
|
||||
"train_batch_size": 2,
|
||||
"trial_name": null,
|
||||
"trial_params": null
|
||||
}
|
||||
3
checkpoint-189/training_args.bin
Normal file
3
checkpoint-189/training_args.bin
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4c0557c0612cd65ef8abf2a6c3d767d5aa1d732f9c315d62b560fc3d0f5beafe
|
||||
size 5713
|
||||
Reference in New Issue
Block a user