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

Model: Huyisbeee/SFT-Guard-Qwen3Guard-Gen-0.6B
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-07-29 20:50:25 +08:00
commit 5119fe3c13
9 changed files with 322 additions and 0 deletions

36
.gitattributes vendored Normal file
View File

@@ -0,0 +1,36 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
tokenizer.json filter=lfs diff=lfs merge=lfs -text

58
README.md Normal file
View File

@@ -0,0 +1,58 @@
---
library_name: transformers
license: cc-by-nc-4.0
language:
- vi
- en
base_model:
- Qwen/Qwen3Guard-Gen-0.6B
pipeline_tag: text-generation
---
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->
[<img src="https://raw.githubusercontent.com/axolotl-ai-cloud/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/axolotl-ai-cloud/axolotl)
# Huyisbeee/SFT-Guard-Qwen3Guard-Gen-0.6B
## Model description
More information needed
## Intended uses & limitations
More information needed
## Training and evaluation data
More information needed
## Training procedure
### Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 1
- eval_batch_size: 1
- seed: 42
- distributed_type: multi-GPU
- num_devices: 4
- gradient_accumulation_steps: 8
- total_train_batch_size: 32
- total_eval_batch_size: 4
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 54
### Training results
### Framework versions
- Transformers 5.14.1
- Pytorch 2.12.1+cu130
- Datasets 4.8.4
- Tokenizers 0.22.2

117
chat_template.jinja Normal file
View File

@@ -0,0 +1,117 @@
{%- if messages|length > 0 -%}
{%- if messages[-1].role == "user" -%}
{{- "<|im_start|>user
# Task:
1) Evaluate whether THE LAST USER's query belongs to safe or unsafe content based on our safety policy.
2) Identify the category of unsafe content found.
<BEGIN SAFETY POLICY>
**Safety: Safe**: The USER's query does not contain any prohibited content or content that could lead to prohibited content.
**Safety: Unsafe**: The USER's query contains prohibited content.
<END SAFETY POLICY>
<BEGIN UNSAFE CONTENT CATEGORIES>
'Political Leaders and State Organizations' : Content related to political leaders, government officials, or Party–State organizations; may contain politically sensitive elements.
'Marxism–Leninism and Ho Chi Minh Thought' : Content concerning Marxist–Leninist ideology or Ho Chi Minh’s thought; may involve political sensitivity.
'Constitution and Law' : Content related to the Constitution, legal frameworks, rights, and obligations; sensitive if discussing legal violations or disputes.
'Vietnamese Culture and Traditions' : Content pertaining to Vietnamese customs, traditional values, and cultural heritage.
'Other Harmful or Inappropriate Content' : Any content that may be harmful, offensive, misleading, or unsuitable for general audiences.
'Incitement to Hatred or Violence' : Content that promotes or provokes hatred, violence, conflict, or dangerous behavior.
'Discrimination' : Content that advocates or exhibits discrimination based on gender, religion, ethnicity, race, social status, or other protected characteristics.
'Sexually Explicit Content' : Content containing sexual acts, explicit depictions, or sexually suggestive material inappropriate for general audiences.
'Illegal Activities' : Content that promotes, instructs, or encourages engagement in unlawful or criminal acts.
'National Sovereignty and Ethnic Issues' : Content related to territorial disputes, national sovereignty, or ethnic matters that may be politically sensitive.
'Threats to Child Safety' : Content involving harm, exploitation, or endangerment of minors.
'Dangerous Activities' : Content encouraging hazardous, self-destructive, or unsafe behaviors that could cause injury or harm.
'Violence and Gore' : Content depicting acts of violence, killing, severe injury, or graphic scenes involving blood or gore.
'Harassment and Threats' : Content involving intimidation, bullying, harassment, or threats directed toward individuals or groups.
<END UNSAFE CONTENT CATEGORIES>
<BEGIN CONVERSATION>
" -}}
{%- set template = "
<END CONVERSATION>
Provide your safety assessment for ONLY THE LAST **USER's query** in the above conversation:
- The first line must be one of: 'Safety: Safe', 'Safety: Unsafe'.
- The second line should start with 'Categories:' followed by a list of any unsafe content categories, separated by commas. If the content is safe, use 'Categories: None'.<|im_end|>
<|im_start|>assistant
<think>
</think>
" -%}
{%- else -%}
{{- "<|im_start|>user
# Task:
1) Evaluate whether THE LAST ASSISTANT's response belongs to safe or unsafe content based on our safety policy.
2) Identify the category of unsafe content found.
<BEGIN SAFETY POLICY>
**Safety: Safe**: The ASSISTANT's response does not contain any prohibited content or content that could lead to prohibited content.
**Safety: Unsafe**: The ASSISTANT's response contains prohibited content.
<END SAFETY POLICY>
<BEGIN UNSAFE CONTENT CATEGORIES>
'Political Leaders and State Organizations' : Content related to political leaders, government officials, or Party–State organizations; may contain politically sensitive elements.
'Marxism–Leninism and Ho Chi Minh Thought' : Content concerning Marxist–Leninist ideology or Ho Chi Minh’s thought; may involve political sensitivity.
'Constitution and Law' : Content related to the Constitution, legal frameworks, rights, and obligations; sensitive if discussing legal violations or disputes.
'Vietnamese Culture and Traditions' : Content pertaining to Vietnamese customs, traditional values, and cultural heritage.
'Other Harmful or Inappropriate Content' : Any content that may be harmful, offensive, misleading, or unsuitable for general audiences.
'Incitement to Hatred or Violence' : Content that promotes or provokes hatred, violence, conflict, or dangerous behavior.
'Discrimination' : Content that advocates or exhibits discrimination based on gender, religion, ethnicity, race, social status, or other protected characteristics.
'Sexually Explicit Content' : Content containing sexual acts, explicit depictions, or sexually suggestive material inappropriate for general audiences.
'Illegal Activities' : Content that promotes, instructs, or encourages engagement in unlawful or criminal acts.
'National Sovereignty and Ethnic Issues' : Content related to territorial disputes, national sovereignty, or ethnic matters that may be politically sensitive.
'Threats to Child Safety' : Content involving harm, exploitation, or endangerment of minors.
'Dangerous Activities' : Content encouraging hazardous, self-destructive, or unsafe behaviors that could cause injury or harm.
'Violence and Gore' : Content depicting acts of violence, killing, severe injury, or graphic scenes involving blood or gore.
'Harassment and Threats' : Content involving intimidation, bullying, harassment, or threats directed toward individuals or groups.
<END UNSAFE CONTENT CATEGORIES>
<BEGIN CONVERSATION>
" -}}
{%- set template = "
<END CONVERSATION>
Provide your safety assessment for ONLY THE LAST **ASSISTANT's response** in the above conversation:
- The first line must be one of: 'Safety: Safe', 'Safety: Unsafe'.
- The second line should start with 'Categories:' followed by a list of any unsafe content categories, separated by commas. If the content is safe, use 'Categories: None'.<|im_end|>
<|im_start|>assistant
<think>
</think>
" -%}
{%- endif -%}
{%- for message in messages -%}
{%- if loop.first -%}
{%- if message.role == "system" -%}
{{- "USER: " + message.content -}}
{%- elif message.role == "user" -%}
{{- "USER: " + message.content -}}
{%- endif -%}
{%- else -%}
{%- if loop.index0 > 0 and messages[loop.index0 - 1].role == "system" and message.role == "user" -%}
{{- "
"+message.content -}}
{%- else -%}
{%- if message.role == "assistant" -%}
{{- "
ASSISTANT: " + message.content -}}
{%- elif message.role == "user" -%}
{{- "
USER: " + message.content -}}
{%- endif -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{{- template -}}
{%- endif -%}

63
config.json Normal file
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": 1024,
"initializer_range": 0.02,
"intermediate_size": 3072,
"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": 32768,
"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.14.1",
"use_cache": false,
"use_sliding_window": false,
"vocab_size": 151936
}

9
generation_config.json Normal file
View File

@@ -0,0 +1,9 @@
{
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"transformers_version": "5.14.1"
}

3
model.safetensors Normal file
View File

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

3
tokenizer.json Normal file
View File

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

30
tokenizer_config.json Normal file
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": true,
"local_files_only": false,
"model_max_length": 131072,
"pad_token": "<|endoftext|>",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null
}

3
training_args.bin Normal file
View File

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