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

Model: Alamori/GoldenNet-Qwen2.5-0.5B-Full-v1
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-06-16 09:40:18 +08:00
commit 2ce77bfa73
19 changed files with 152047 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

134
README.md Normal file
View File

@@ -0,0 +1,134 @@
---
license: apache-2.0
language:
- ar
- en
base_model: Qwen/Qwen2.5-0.5B-Instruct
tags:
- qwen2
- arabic
- iraqi
- government
- classification
- ner
- fine-tuned
- full-finetune
- goldennet
datasets:
- custom
pipeline_tag: text-generation
library_name: transformers
model-index:
- name: GoldenNet-Qwen2.5-0.5B-Full-v1
results:
- task:
type: text-classification
name: Document Classification
metrics:
- type: loss
value: 0.3636
name: Eval Loss
---
# GoldenNet-Qwen2.5-0.5B-Full-v1
<div align="center">
<img src="https://img.shields.io/badge/Golden%20Net%20AI-Iraqi%20Gov%20NLP-gold?style=for-the-badge" alt="Golden Net AI"/>
<img src="https://img.shields.io/badge/Method-Full%20Fine--tune-red?style=for-the-badge" alt="Full"/>
<img src="https://img.shields.io/badge/Language-Arabic-green?style=for-the-badge" alt="Arabic"/>
</div>
## Model Description
**GoldenNet-Qwen2.5-0.5B-Full-v1** is a fully fine-tuned version of [Qwen/Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct) specialized for **Iraqi Government Correspondence Processing**.
This is the **full fine-tuning** variant where all 494M parameters were trained, potentially offering the best task-specific performance.
### Tasks
1. **Document Classification** - 8 categories (طلب، شكوى، تقرير، إعلام، استفسار، دعوة، تعميم، إحالة)
2. **Named Entity Recognition** - Extracts persons, organizations, locations, dates, monetary values, laws
## Model Comparison
| Model | Method | Train Loss | Eval Loss | Training Time | Size |
|-------|--------|------------|-----------|---------------|------|
| [QLoRA-v1](https://huggingface.co/Alamori/GoldenNet-Qwen2.5-0.5B-QLoRA-v1) | 4-bit QLoRA | 0.448 | **0.2998** | 49s | 943MB |
| [LoRA-v1](https://huggingface.co/Alamori/GoldenNet-Qwen2.5-0.5B-LoRA-v1) | Standard LoRA | 0.496 | 0.3665 | 70s | 943MB |
| **Full-v1** | Full Fine-tune | **0.461** | 0.3636 | 121s | 1.9GB |
## Training Details
| Parameter | Value |
|-----------|-------|
| Base Model | Qwen/Qwen2.5-0.5B-Instruct |
| Fine-tuning Method | Full (all parameters) |
| Learning Rate | 5e-5 |
| Optimizer | AdamW 8-bit |
| Epochs | 3 |
| Batch Size | 1 (effective: 16) |
| Max Sequence Length | 1024 |
| Precision | BF16 |
| Trainable Parameters | 494M (100%) |
| Hardware | NVIDIA RTX 5070 (8GB VRAM) |
### Loss Progression
- Epoch 1: 0.983
- Epoch 2: 0.328
- Epoch 3: 0.171 (lowest among all variants!)
## Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"Alamori/GoldenNet-Qwen2.5-0.5B-Full-v1",
device_map="auto",
torch_dtype="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Alamori/GoldenNet-Qwen2.5-0.5B-Full-v1")
# Classification example
correspondence = """جمهورية العراق
وزارة التربية
العدد: 1234/ت/2025
إلى/ السيد مدير عام التعليم المحترم
م/ طلب تعيين معلمين
نرجو الموافقة على تعيين 50 معلماً.
مع التقدير"""
instruction = "صنّف المراسلة الحكومية التالية إلى إحدى الفئات: طلب، شكوى، تقرير، إعلام، استفسار، دعوة، تعميم، إحالة. أجب بصيغة JSON."
messages = [{"role": "user", "content": f"{instruction}\n\n{correspondence}"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.1)
print(tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True))
```
## When to Use This Model
- **Use Full-v1** when you need maximum task-specific performance and have sufficient storage/memory
- **Use QLoRA-v1** for best balance of quality and efficiency (recommended for most cases)
- **Use LoRA-v1** for comparison or when you need standard LoRA compatibility
## Related Models
- [GoldenNet-Qwen2.5-0.5B-QLoRA-v1](https://huggingface.co/Alamori/GoldenNet-Qwen2.5-0.5B-QLoRA-v1) - 4-bit quantized (best eval loss)
- [GoldenNet-Qwen2.5-0.5B-LoRA-v1](https://huggingface.co/Alamori/GoldenNet-Qwen2.5-0.5B-LoRA-v1) - Standard LoRA
## License
Apache 2.0
---
<div align="center">
<b>Developed by Golden Net AI</b><br>
<i>Empowering Iraqi Government Digital Transformation</i>
</div>

24
added_tokens.json Normal file
View File

@@ -0,0 +1,24 @@
{
"</tool_call>": 151658,
"<tool_call>": 151657,
"<|box_end|>": 151649,
"<|box_start|>": 151648,
"<|endoftext|>": 151643,
"<|file_sep|>": 151664,
"<|fim_middle|>": 151660,
"<|fim_pad|>": 151662,
"<|fim_prefix|>": 151659,
"<|fim_suffix|>": 151661,
"<|im_end|>": 151645,
"<|im_start|>": 151644,
"<|image_pad|>": 151655,
"<|object_ref_end|>": 151647,
"<|object_ref_start|>": 151646,
"<|quad_end|>": 151651,
"<|quad_start|>": 151650,
"<|repo_name|>": 151663,
"<|video_pad|>": 151656,
"<|vision_end|>": 151653,
"<|vision_pad|>": 151654,
"<|vision_start|>": 151652
}

12
all_results.json Normal file
View File

@@ -0,0 +1,12 @@
{
"epoch": 3.0,
"eval_loss": 0.36356300115585327,
"eval_runtime": 0.7586,
"eval_samples_per_second": 26.364,
"eval_steps_per_second": 26.364,
"total_flos": 359524401020928.0,
"train_loss": 0.46062264027017535,
"train_runtime": 120.7529,
"train_samples_per_second": 4.298,
"train_steps_per_second": 0.273
}

54
chat_template.jinja Normal file
View File

@@ -0,0 +1,54 @@
{%- if tools %}
{{- '<|im_start|>system\n' }}
{%- if messages[0]['role'] == 'system' %}
{{- messages[0]['content'] }}
{%- else %}
{{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
{%- endif %}
{{- "\n\n# 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' }}
{%- else %}
{{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- for message in messages %}
{%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
{%- elif message.role == "assistant" %}
{{- '<|im_start|>' + message.role }}
{%- if message.content %}
{{- '\n' + message.content }}
{%- endif %}
{%- for tool_call in message.tool_calls %}
{%- if tool_call.function is defined %}
{%- set tool_call = tool_call.function %}
{%- endif %}
{{- '\n<tool_call>\n{"name": "' }}
{{- tool_call.name }}
{{- '", "arguments": ' }}
{{- tool_call.arguments | tojson }}
{{- '}\n</tool_call>' }}
{%- endfor %}
{{- '<|im_end|>\n' }}
{%- elif message.role == "tool" %}
{%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
{{- '<|im_start|>user' }}
{%- endif %}
{{- '\n<tool_response>\n' }}
{{- message.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' }}
{%- endif %}

54
config.json Normal file
View File

@@ -0,0 +1,54 @@
{
"architectures": [
"Qwen2ForCausalLM"
],
"attention_dropout": 0.0,
"dtype": "float32",
"eos_token_id": 151645,
"hidden_act": "silu",
"hidden_size": 896,
"initializer_range": 0.02,
"intermediate_size": 4864,
"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"
],
"max_position_embeddings": 32768,
"max_window_layers": 21,
"model_type": "qwen2",
"num_attention_heads": 14,
"num_hidden_layers": 24,
"num_key_value_heads": 2,
"pad_token_id": 151643,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 1000000.0,
"sliding_window": null,
"tie_word_embeddings": true,
"transformers_version": "4.57.1",
"use_cache": false,
"use_sliding_window": false,
"vocab_size": 151936
}

7
eval_results.json Normal file
View File

@@ -0,0 +1,7 @@
{
"epoch": 3.0,
"eval_loss": 0.36356300115585327,
"eval_runtime": 0.7586,
"eval_samples_per_second": 26.364,
"eval_steps_per_second": 26.364
}

13
generation_config.json Normal file
View File

@@ -0,0 +1,13 @@
{
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"repetition_penalty": 1.1,
"temperature": 0.7,
"top_k": 20,
"top_p": 0.8,
"transformers_version": "4.57.1"
}

151388
merges.txt Normal file

File diff suppressed because it is too large Load Diff

3
model.safetensors Normal file
View File

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

31
special_tokens_map.json Normal file
View File

@@ -0,0 +1,31 @@
{
"additional_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|>"
],
"eos_token": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

3
tokenizer.json Normal file
View File

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

208
tokenizer_config.json Normal file
View File

@@ -0,0 +1,208 @@
{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"151643": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151644": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151645": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151646": {
"content": "<|object_ref_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151647": {
"content": "<|object_ref_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151648": {
"content": "<|box_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151649": {
"content": "<|box_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151650": {
"content": "<|quad_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151651": {
"content": "<|quad_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151652": {
"content": "<|vision_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151653": {
"content": "<|vision_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151654": {
"content": "<|vision_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151655": {
"content": "<|image_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151656": {
"content": "<|video_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151657": {
"content": "<tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151658": {
"content": "</tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151659": {
"content": "<|fim_prefix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151660": {
"content": "<|fim_middle|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151661": {
"content": "<|fim_suffix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151662": {
"content": "<|fim_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151663": {
"content": "<|repo_name|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151664": {
"content": "<|file_sep|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
}
},
"additional_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|>"
],
"bos_token": null,
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"errors": "replace",
"extra_special_tokens": {},
"model_max_length": 131072,
"pad_token": "<|endoftext|>",
"padding_side": "right",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null
}

8
train_results.json Normal file
View File

@@ -0,0 +1,8 @@
{
"epoch": 3.0,
"total_flos": 359524401020928.0,
"train_loss": 0.46062264027017535,
"train_runtime": 120.7529,
"train_samples_per_second": 4.298,
"train_steps_per_second": 0.273
}

4
trainer_log.jsonl Normal file
View File

@@ -0,0 +1,4 @@
{"current_steps": 10, "total_steps": 33, "loss": 0.9831, "lr": 4.642142940418973e-05, "epoch": 0.9248554913294798, "percentage": 30.3, "elapsed_time": "0:00:32", "remaining_time": "0:01:14"}
{"current_steps": 20, "total_steps": 33, "loss": 0.3275, "lr": 2.3646527285364565e-05, "epoch": 1.8323699421965318, "percentage": 60.61, "elapsed_time": "0:01:03", "remaining_time": "0:00:41"}
{"current_steps": 30, "total_steps": 33, "loss": 0.1705, "lr": 2.310614508226078e-06, "epoch": 2.739884393063584, "percentage": 90.91, "elapsed_time": "0:01:36", "remaining_time": "0:00:09"}
{"current_steps": 33, "total_steps": 33, "epoch": 3.0, "percentage": 100.0, "elapsed_time": "0:02:00", "remaining_time": "0:00:00"}

64
trainer_state.json Normal file
View File

@@ -0,0 +1,64 @@
{
"best_global_step": null,
"best_metric": null,
"best_model_checkpoint": null,
"epoch": 3.0,
"eval_steps": 100,
"global_step": 33,
"is_hyper_param_search": false,
"is_local_process_zero": true,
"is_world_process_zero": true,
"log_history": [
{
"epoch": 0.9248554913294798,
"grad_norm": 10.499038696289062,
"learning_rate": 4.642142940418973e-05,
"loss": 0.9831,
"step": 10
},
{
"epoch": 1.8323699421965318,
"grad_norm": 6.037228584289551,
"learning_rate": 2.3646527285364565e-05,
"loss": 0.3275,
"step": 20
},
{
"epoch": 2.739884393063584,
"grad_norm": 3.610978126525879,
"learning_rate": 2.310614508226078e-06,
"loss": 0.1705,
"step": 30
},
{
"epoch": 3.0,
"step": 33,
"total_flos": 359524401020928.0,
"train_loss": 0.46062264027017535,
"train_runtime": 120.7529,
"train_samples_per_second": 4.298,
"train_steps_per_second": 0.273
}
],
"logging_steps": 10,
"max_steps": 33,
"num_input_tokens_seen": 0,
"num_train_epochs": 3,
"save_steps": 100,
"stateful_callbacks": {
"TrainerControl": {
"args": {
"should_epoch_stop": false,
"should_evaluate": false,
"should_log": false,
"should_save": true,
"should_training_stop": true
},
"attributes": {}
}
},
"total_flos": 359524401020928.0,
"train_batch_size": 1,
"trial_name": null,
"trial_params": null
}

3
training_args.bin Normal file
View File

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

BIN
training_loss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

1
vocab.json Normal file

File diff suppressed because one or more lines are too long