初始化项目,由ModelHub XC社区提供模型

Model: cs-552-2026-the-transformers/safety_model
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-06-23 12:32:19 +08:00
commit ba0c6eecaf
175 changed files with 19015 additions and 0 deletions

View 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 %}

View 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
}

View 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"
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:951f2b23ef2764a406e964232deb576dbdac03ecc12a915a7b6769a28bb6b0d3
size 3441185608

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d5c52d266003d1fcf6508385fbefb47376a16b44545120a5a24b22238218b763
size 6882572207

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:61c19bab1174704a4a4441475683bf1270277af15d2e2c95e964789128e482c4
size 14645

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:44b16da41da49faf8d18f42bb521bad9cc5ae54d5e5510c0cebaefaeee8251fb
size 1465

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
size 11422650

View 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
}

View File

@@ -0,0 +1,504 @@
{
"best_global_step": null,
"best_metric": null,
"best_model_checkpoint": null,
"epoch": 1.0,
"eval_steps": 500,
"global_step": 475,
"is_hyper_param_search": false,
"is_local_process_zero": true,
"is_world_process_zero": true,
"log_history": [
{
"entropy": 0.8691443920135498,
"epoch": 0.021085925144965736,
"grad_norm": 47.5,
"learning_rate": 7.2e-07,
"loss": 2.1268569946289064,
"mean_token_accuracy": 0.5856592752039432,
"num_tokens": 53385.0,
"step": 10
},
{
"entropy": 0.9018128983676433,
"epoch": 0.04217185028993147,
"grad_norm": 49.25,
"learning_rate": 1.52e-06,
"loss": 2.1235822677612304,
"mean_token_accuracy": 0.5826416034251451,
"num_tokens": 108949.0,
"step": 20
},
{
"entropy": 0.9313402399420738,
"epoch": 0.0632577754348972,
"grad_norm": 38.25,
"learning_rate": 2.3200000000000002e-06,
"loss": 1.9997358322143555,
"mean_token_accuracy": 0.5817345686256885,
"num_tokens": 162034.0,
"step": 30
},
{
"entropy": 0.9819381944835186,
"epoch": 0.08434370057986294,
"grad_norm": 28.25,
"learning_rate": 3.12e-06,
"loss": 1.8760208129882812,
"mean_token_accuracy": 0.5874959267675877,
"num_tokens": 214165.0,
"step": 40
},
{
"entropy": 1.0624087303876877,
"epoch": 0.10542962572482868,
"grad_norm": 14.1875,
"learning_rate": 3.920000000000001e-06,
"loss": 1.6169570922851562,
"mean_token_accuracy": 0.601640059798956,
"num_tokens": 265527.0,
"step": 50
},
{
"entropy": 1.1721510097384453,
"epoch": 0.1265155508697944,
"grad_norm": 11.3125,
"learning_rate": 4.7200000000000005e-06,
"loss": 1.4622878074645995,
"mean_token_accuracy": 0.6209174185991287,
"num_tokens": 319341.0,
"step": 60
},
{
"entropy": 1.2009219758212566,
"epoch": 0.14760147601476015,
"grad_norm": 9.0625,
"learning_rate": 5.5200000000000005e-06,
"loss": 1.2933337211608886,
"mean_token_accuracy": 0.6467074818909169,
"num_tokens": 373709.0,
"step": 70
},
{
"entropy": 1.1439887225627898,
"epoch": 0.16868740115972589,
"grad_norm": 9.3125,
"learning_rate": 6.3200000000000005e-06,
"loss": 1.2084498405456543,
"mean_token_accuracy": 0.6660686552524566,
"num_tokens": 425923.0,
"step": 80
},
{
"entropy": 1.0713621236383915,
"epoch": 0.18977332630469163,
"grad_norm": 7.84375,
"learning_rate": 7.1200000000000004e-06,
"loss": 1.1175435066223145,
"mean_token_accuracy": 0.6812180563807487,
"num_tokens": 480012.0,
"step": 90
},
{
"entropy": 1.0369222231209279,
"epoch": 0.21085925144965736,
"grad_norm": 7.09375,
"learning_rate": 7.92e-06,
"loss": 1.062850570678711,
"mean_token_accuracy": 0.6899570092558861,
"num_tokens": 533890.0,
"step": 100
},
{
"entropy": 0.9894454136490822,
"epoch": 0.23194517659462308,
"grad_norm": 7.75,
"learning_rate": 8.720000000000001e-06,
"loss": 1.0150799751281738,
"mean_token_accuracy": 0.7009239844977856,
"num_tokens": 590654.0,
"step": 110
},
{
"entropy": 0.9410129584372043,
"epoch": 0.2530311017395888,
"grad_norm": 7.28125,
"learning_rate": 9.52e-06,
"loss": 0.9810515403747558,
"mean_token_accuracy": 0.709618617594242,
"num_tokens": 643080.0,
"step": 120
},
{
"entropy": 0.9265115469694137,
"epoch": 0.2741170268845546,
"grad_norm": 7.46875,
"learning_rate": 1.0320000000000001e-05,
"loss": 0.9485825538635254,
"mean_token_accuracy": 0.7162063598632813,
"num_tokens": 697254.0,
"step": 130
},
{
"entropy": 0.9009825974702835,
"epoch": 0.2952029520295203,
"grad_norm": 6.96875,
"learning_rate": 1.1120000000000002e-05,
"loss": 0.9119878768920898,
"mean_token_accuracy": 0.7238413639366627,
"num_tokens": 751774.0,
"step": 140
},
{
"entropy": 0.9040703341364861,
"epoch": 0.316288877174486,
"grad_norm": 7.21875,
"learning_rate": 1.1920000000000001e-05,
"loss": 0.9283308029174805,
"mean_token_accuracy": 0.7166316144168376,
"num_tokens": 808927.0,
"step": 150
},
{
"entropy": 0.8878034949302673,
"epoch": 0.33737480231945177,
"grad_norm": 7.375,
"learning_rate": 1.2720000000000002e-05,
"loss": 0.9068665504455566,
"mean_token_accuracy": 0.7254431843757629,
"num_tokens": 858559.0,
"step": 160
},
{
"entropy": 0.887480016052723,
"epoch": 0.3584607274644175,
"grad_norm": 7.65625,
"learning_rate": 1.3520000000000003e-05,
"loss": 0.8971159934997559,
"mean_token_accuracy": 0.7258390121161937,
"num_tokens": 912285.0,
"step": 170
},
{
"entropy": 0.8527634374797344,
"epoch": 0.37954665260938325,
"grad_norm": 7.6875,
"learning_rate": 1.432e-05,
"loss": 0.8586221694946289,
"mean_token_accuracy": 0.7359919100999832,
"num_tokens": 969385.0,
"step": 180
},
{
"entropy": 0.8445627830922604,
"epoch": 0.40063257775434896,
"grad_norm": 7.03125,
"learning_rate": 1.5120000000000001e-05,
"loss": 0.855714225769043,
"mean_token_accuracy": 0.7341729424893856,
"num_tokens": 1026106.0,
"step": 190
},
{
"entropy": 0.841130618005991,
"epoch": 0.42171850289931473,
"grad_norm": 7.21875,
"learning_rate": 1.5920000000000003e-05,
"loss": 0.8620488166809082,
"mean_token_accuracy": 0.7361006513237953,
"num_tokens": 1079743.0,
"step": 200
},
{
"entropy": 0.831258487701416,
"epoch": 0.44280442804428044,
"grad_norm": 7.0,
"learning_rate": 1.672e-05,
"loss": 0.8441590309143067,
"mean_token_accuracy": 0.7379129216074943,
"num_tokens": 1131453.0,
"step": 210
},
{
"entropy": 0.79731200709939,
"epoch": 0.46389035318924615,
"grad_norm": 7.875,
"learning_rate": 1.752e-05,
"loss": 0.8135190963745117,
"mean_token_accuracy": 0.7497627973556519,
"num_tokens": 1182486.0,
"step": 220
},
{
"entropy": 0.8269097700715065,
"epoch": 0.4849762783342119,
"grad_norm": 7.5625,
"learning_rate": 1.832e-05,
"loss": 0.8399410247802734,
"mean_token_accuracy": 0.7389348305761814,
"num_tokens": 1238136.0,
"step": 230
},
{
"entropy": 0.8093138128519058,
"epoch": 0.5060622034791776,
"grad_norm": 7.40625,
"learning_rate": 1.912e-05,
"loss": 0.810025691986084,
"mean_token_accuracy": 0.7460841409862041,
"num_tokens": 1294939.0,
"step": 240
},
{
"entropy": 0.8069386176764966,
"epoch": 0.5271481286241434,
"grad_norm": 6.84375,
"learning_rate": 1.9920000000000002e-05,
"loss": 0.8215888023376465,
"mean_token_accuracy": 0.7438369721174241,
"num_tokens": 1346462.0,
"step": 250
},
{
"entropy": 0.8088659413158894,
"epoch": 0.5482340537691092,
"grad_norm": 6.75,
"learning_rate": 1.9920000000000002e-05,
"loss": 0.8201449394226075,
"mean_token_accuracy": 0.7393839374184609,
"num_tokens": 1397444.0,
"step": 260
},
{
"entropy": 0.7969542622566224,
"epoch": 0.5693199789140748,
"grad_norm": 6.59375,
"learning_rate": 1.9831111111111113e-05,
"loss": 0.8009759902954101,
"mean_token_accuracy": 0.7512488305568695,
"num_tokens": 1453900.0,
"step": 270
},
{
"entropy": 0.780416651815176,
"epoch": 0.5904059040590406,
"grad_norm": 7.21875,
"learning_rate": 1.9742222222222223e-05,
"loss": 0.7874263763427735,
"mean_token_accuracy": 0.7526524804532528,
"num_tokens": 1505529.0,
"step": 280
},
{
"entropy": 0.7752278268337249,
"epoch": 0.6114918292040064,
"grad_norm": 6.875,
"learning_rate": 1.9653333333333334e-05,
"loss": 0.8075678825378418,
"mean_token_accuracy": 0.746569037437439,
"num_tokens": 1562473.0,
"step": 290
},
{
"entropy": 0.7895354829728604,
"epoch": 0.632577754348972,
"grad_norm": 6.6875,
"learning_rate": 1.9564444444444444e-05,
"loss": 0.7880948543548584,
"mean_token_accuracy": 0.7494045957922936,
"num_tokens": 1613320.0,
"step": 300
},
{
"entropy": 0.7653828673064709,
"epoch": 0.6536636794939378,
"grad_norm": 6.78125,
"learning_rate": 1.9475555555555558e-05,
"loss": 0.7780828475952148,
"mean_token_accuracy": 0.7556171745061875,
"num_tokens": 1662847.0,
"step": 310
},
{
"entropy": 0.7652887552976608,
"epoch": 0.6747496046389035,
"grad_norm": 6.375,
"learning_rate": 1.938666666666667e-05,
"loss": 0.7539787292480469,
"mean_token_accuracy": 0.7582654722034932,
"num_tokens": 1718553.0,
"step": 320
},
{
"entropy": 0.7076033115386963,
"epoch": 0.6958355297838693,
"grad_norm": 7.15625,
"learning_rate": 1.929777777777778e-05,
"loss": 0.7396605491638184,
"mean_token_accuracy": 0.7659220136702061,
"num_tokens": 1771024.0,
"step": 330
},
{
"entropy": 0.7509547933936119,
"epoch": 0.716921454928835,
"grad_norm": 6.15625,
"learning_rate": 1.920888888888889e-05,
"loss": 0.7459388256072998,
"mean_token_accuracy": 0.7644543245434761,
"num_tokens": 1821303.0,
"step": 340
},
{
"entropy": 0.7591827407479286,
"epoch": 0.7380073800738007,
"grad_norm": 7.03125,
"learning_rate": 1.912e-05,
"loss": 0.7627717971801757,
"mean_token_accuracy": 0.7567056350409984,
"num_tokens": 1868674.0,
"step": 350
},
{
"entropy": 0.7316406652331352,
"epoch": 0.7590933052187665,
"grad_norm": 6.59375,
"learning_rate": 1.9031111111111114e-05,
"loss": 0.7425707340240478,
"mean_token_accuracy": 0.7653280735015869,
"num_tokens": 1924619.0,
"step": 360
},
{
"entropy": 0.7539067789912224,
"epoch": 0.7801792303637322,
"grad_norm": 7.0625,
"learning_rate": 1.8942222222222224e-05,
"loss": 0.7716987609863282,
"mean_token_accuracy": 0.7524559155106545,
"num_tokens": 1978795.0,
"step": 370
},
{
"entropy": 0.7687754213809967,
"epoch": 0.8012651555086979,
"grad_norm": 7.1875,
"learning_rate": 1.8853333333333335e-05,
"loss": 0.7734373569488525,
"mean_token_accuracy": 0.7497503250837326,
"num_tokens": 2029994.0,
"step": 380
},
{
"entropy": 0.7508607231080532,
"epoch": 0.8223510806536637,
"grad_norm": 7.09375,
"learning_rate": 1.8764444444444445e-05,
"loss": 0.7575721740722656,
"mean_token_accuracy": 0.7572125047445297,
"num_tokens": 2082653.0,
"step": 390
},
{
"entropy": 0.7252861328423024,
"epoch": 0.8434370057986295,
"grad_norm": 6.5625,
"learning_rate": 1.867555555555556e-05,
"loss": 0.7381186485290527,
"mean_token_accuracy": 0.7612978041172027,
"num_tokens": 2135276.0,
"step": 400
},
{
"entropy": 0.7339485622942448,
"epoch": 0.8645229309435951,
"grad_norm": 6.625,
"learning_rate": 1.858666666666667e-05,
"loss": 0.7348906993865967,
"mean_token_accuracy": 0.7663561321794987,
"num_tokens": 2187466.0,
"step": 410
},
{
"entropy": 0.7272624362260103,
"epoch": 0.8856088560885609,
"grad_norm": 6.90625,
"learning_rate": 1.849777777777778e-05,
"loss": 0.749025821685791,
"mean_token_accuracy": 0.7617379955947399,
"num_tokens": 2237434.0,
"step": 420
},
{
"entropy": 0.7477380312979222,
"epoch": 0.9066947812335266,
"grad_norm": 6.34375,
"learning_rate": 1.840888888888889e-05,
"loss": 0.7498275756835937,
"mean_token_accuracy": 0.7604753144085408,
"num_tokens": 2288985.0,
"step": 430
},
{
"entropy": 0.7346535548567772,
"epoch": 0.9277807063784923,
"grad_norm": 6.9375,
"learning_rate": 1.832e-05,
"loss": 0.739972448348999,
"mean_token_accuracy": 0.7658773727715016,
"num_tokens": 2341187.0,
"step": 440
},
{
"entropy": 0.7167556572705507,
"epoch": 0.9488666315234581,
"grad_norm": 6.4375,
"learning_rate": 1.823111111111111e-05,
"loss": 0.7350784778594971,
"mean_token_accuracy": 0.7644179269671441,
"num_tokens": 2393385.0,
"step": 450
},
{
"entropy": 0.7537519961595536,
"epoch": 0.9699525566684238,
"grad_norm": 7.28125,
"learning_rate": 1.814222222222222e-05,
"loss": 0.757652759552002,
"mean_token_accuracy": 0.7587068513035774,
"num_tokens": 2442248.0,
"step": 460
},
{
"entropy": 0.72038439437747,
"epoch": 0.9910384818133896,
"grad_norm": 7.40625,
"learning_rate": 1.8053333333333332e-05,
"loss": 0.7361824035644531,
"mean_token_accuracy": 0.7609050884842873,
"num_tokens": 2498394.0,
"step": 470
}
],
"logging_steps": 10,
"max_steps": 2500,
"num_input_tokens_seen": 0,
"num_train_epochs": 6,
"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": 2.5798444746092544e+16,
"train_batch_size": 2,
"trial_name": null,
"trial_params": null
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7103b0ce3340ea41aca3b7441d01d7c38791e3d3ce8c9b28c906c9b1d49bbee9
size 5713