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

Model: ali-elganzory/Baguettotron-longsft_16k-DPO-Tulu3-decontaminated
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-04-28 10:22:11 +08:00
commit b1dd7b86f3
14 changed files with 331120 additions and 0 deletions

35
.gitattributes vendored Normal file
View File

@@ -0,0 +1,35 @@
*.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

69
README.md Normal file
View File

@@ -0,0 +1,69 @@
---
base_model: ali-elganzory/Baguettotron-longsft_16k-SFT-Tulu3-decontaminated
library_name: transformers
model_name: Baguettotron-longsft_16k-DPO-Tulu3-decontaminated
tags:
- generated_from_trainer
- trl
- dpo
licence: license
---
# Model Card for Baguettotron-longsft_16k-DPO-Tulu3-decontaminated
This model is a fine-tuned version of [ali-elganzory/Baguettotron-longsft_16k-SFT-Tulu3-decontaminated](https://huggingface.co/ali-elganzory/Baguettotron-longsft_16k-SFT-Tulu3-decontaminated).
It has been trained using [TRL](https://github.com/huggingface/trl).
## Quick start
```python
from transformers import pipeline
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
generator = pipeline("text-generation", model="None", device="cuda")
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
print(output["generated_text"])
```
## Training procedure
This model was trained with DPO, a method introduced in [Direct Preference Optimization: Your Language Model is Secretly a Reward Model](https://huggingface.co/papers/2305.18290).
### Framework versions
- TRL: 0.27.1
- Transformers: 4.57.6
- Pytorch: 2.6.0+cu126
- Datasets: 4.8.4
- Tokenizers: 0.22.2
## Citations
Cite DPO as:
```bibtex
@inproceedings{rafailov2023direct,
title = {{Direct Preference Optimization: Your Language Model is Secretly a Reward Model}},
author = {Rafael Rafailov and Archit Sharma and Eric Mitchell and Christopher D. Manning and Stefano Ermon and Chelsea Finn},
year = 2023,
booktitle = {Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023},
url = {http://papers.nips.cc/paper_files/paper/2023/hash/a85b405ed65c6477a4fe8302b5e06ce7-Abstract-Conference.html},
editor = {Alice Oh and Tristan Naumann and Amir Globerson and Kate Saenko and Moritz Hardt and Sergey Levine},
}
```
Cite TRL as:
```bibtex
@misc{vonwerra2022trl,
title = {{TRL: Transformer Reinforcement Learning}},
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
year = 2020,
journal = {GitHub repository},
publisher = {GitHub},
howpublished = {\url{https://github.com/huggingface/trl}}
}
```

9
all_results.json Normal file
View File

@@ -0,0 +1,9 @@
{
"epoch": 1.0,
"total_flos": 0.0,
"train_loss": 4.194636241930751,
"train_runtime": 7092.6143,
"train_samples": 272585,
"train_samples_per_second": 38.432,
"train_steps_per_second": 0.3
}

25
chat_template.jinja Normal file
View File

@@ -0,0 +1,25 @@
{%- for message in messages -%}
{%- if message["role"] == "system" -%}
{{- "<|system|>
" + message["content"] + "
" -}}
{%- elif message["role"] == "user" -%}
{{- "<|user|>
" + message["content"] + "
" -}}
{%- elif message["role"] == "assistant" -%}
{%- if not loop.last -%}
{{- "<|assistant|>
" + message["content"] + eos_token + "
" -}}
{%- else -%}
{{- "<|assistant|>
" + message["content"] + eos_token -}}
{%- endif -%}
{%- endif -%}
{%- if loop.last and add_generation_prompt -%}
{{- "<|assistant|>
" -}}
{%- endif -%}
{%- endfor -%}

34
config.json Normal file
View File

@@ -0,0 +1,34 @@
{
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 1,
"dtype": "bfloat16",
"eos_token_id": 65492,
"head_dim": 64,
"hidden_act": "silu",
"hidden_size": 576,
"initializer_range": 0.02,
"intermediate_size": 1536,
"max_position_embeddings": 16384,
"mlp_bias": false,
"model_type": "llama",
"num_attention_heads": 9,
"num_hidden_layers": 80,
"num_key_value_heads": 3,
"pad_token_id": 3,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_scaling": {
"factor": 4.0,
"original_max_position_embeddings": 4096,
"rope_type": "yarn"
},
"rope_theta": 10000,
"tie_word_embeddings": true,
"transformers_version": "4.57.6",
"use_cache": false,
"vocab_size": 65600
}

52
config.yaml Normal file
View File

@@ -0,0 +1,52 @@
model_name_or_path: ali-elganzory/Baguettotron-longsft_16k-SFT-Tulu3-decontaminated
dtype: bfloat16
attn_implementation: flash_attention_2
trust_remote_code: true
chat_template: "\n{%- for message in messages -%}\n\t{%- if message[\"role\"] == \"\
system\" -%}\n\t\t{{- \"<|system|>\n\" + message[\"content\"] + \"\n\" -}}\n\t{%-\
\ elif message[\"role\"] == \"user\" -%}\n\t\t{{- \"<|user|>\n\" + message[\"content\"\
] + \"\n\" -}}\n\t{%- elif message[\"role\"] == \"assistant\" -%}\n\t\t{%- if not\
\ loop.last -%}\n\t\t\t{{- \"<|assistant|>\n\" + message[\"content\"] + eos_token\
\ + \"\n\" -}}\n\t\t{%- else -%}\n\t\t\t{{- \"<|assistant|>\n\" + message[\"content\"\
] + eos_token -}}\n\t\t{%- endif -%}\n\t{%- endif -%}\n\t{%- if loop.last and add_generation_prompt\
\ -%}\n\t\t{{- \"<|assistant|>\n\" -}}\n\t{%- endif -%}\n{%- endfor -%}\n"
additional_special_tokens:
- <|system|>
- <|user|>
- <|assistant|>
dataset_mixture:
datasets:
- id: ali-elganzory/llama-3.1-tulu-3-8b-preference-mixture-decontaminated
config: default
split: train
columns:
- chosen
- rejected
dataset_num_proc: 32
remove_unused_columns: true
eval_strategy: 'no'
output_dir: /e/project1/reformo/ali/alignment-handbook/results/mv_exp/dpo/ali-elganzory-Baguettotron-longsft_16k-SFT-Tulu3-decontaminated_tulu-3-8b-preference-mixture-decontaminated_GH200
overwrite_output_dir: false
save_strategy: steps
save_steps: 200
save_total_limit: 2
log_level: info
report_to:
- wandb
logging_steps: 10
logging_strategy: steps
seed: 42
bf16: true
gradient_checkpointing: true
gradient_checkpointing_kwargs:
use_reentrant: false
learning_rate: 5.0e-07
lr_scheduler_type: linear
max_length: 2048
beta: 5
warmup_ratio: 0.1
per_device_train_batch_size: 32
gradient_accumulation_steps: 1
num_train_epochs: 1
hub_model_id: ali-elganzory/Baguettotron-longsft_16k-DPO-Tulu3-decontaminated
hub_strategy: every_save

9
generation_config.json Normal file
View File

@@ -0,0 +1,9 @@
{
"_from_model_config": true,
"bos_token_id": 1,
"eos_token_id": [
65492
],
"pad_token_id": 3,
"transformers_version": "4.57.6"
}

3
model.safetensors Normal file
View File

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

80
special_tokens_map.json Normal file
View File

@@ -0,0 +1,80 @@
{
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<think>",
"</think>",
"source_1",
"source_2",
"source_3",
"source_4",
"source_5",
"source_6",
"source_7",
"source_8",
"source_9",
"source_10",
"<ref",
"</ref>",
"→",
"↺",
"※",
"?maybe?",
"●",
"◐",
"○",
"⚠",
"☐",
"☑",
"✓",
"⟨H≈0.1⟩",
"⟨H≈0.2⟩",
"⟨H≈0.3⟩",
"⟨H≈0.4⟩",
"⟨H≈0.5⟩",
"⟨H≈0.6⟩",
"⟨H≈0.7⟩",
"⟨H≈0.8⟩",
"⟨H≈0.9⟩",
"⟨H≈1.0⟩",
"⟨H≈1.1⟩",
"⟨H≈1.2⟩",
"⟨H≈1.3⟩",
"⟨H≈1.4⟩",
"⟨H≈1.5⟩",
"⟨H≈1.6⟩",
"⟨H≈1.7⟩",
"⟨H≈1.8⟩",
"<|system|>",
"<|user|>",
"<|assistant|>"
],
"bos_token": {
"content": "<|begin_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "[PAD]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"unk_token": {
"content": "[UNK]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

327074
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

480
tokenizer_config.json Normal file
View File

@@ -0,0 +1,480 @@
{
"added_tokens_decoder": {
"0": {
"content": "[UNK]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"1": {
"content": "<|begin_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "<|end_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"3": {
"content": "[PAD]",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65491": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65492": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65493": {
"content": "<think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65494": {
"content": "</think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65495": {
"content": "source_1",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65496": {
"content": "source_2",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65497": {
"content": "source_3",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65498": {
"content": "source_4",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65499": {
"content": "source_5",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65500": {
"content": "source_6",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65501": {
"content": "source_7",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65502": {
"content": "source_8",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65503": {
"content": "source_9",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65504": {
"content": "source_10",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65505": {
"content": "<ref",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65506": {
"content": "</ref>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65507": {
"content": "→",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65508": {
"content": "↺",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65509": {
"content": "※",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65510": {
"content": "?maybe?",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65511": {
"content": "●",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65512": {
"content": "◐",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65513": {
"content": "○",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65514": {
"content": "⚠",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65515": {
"content": "☐",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65516": {
"content": "☑",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65517": {
"content": "✓",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65518": {
"content": "⟨H≈0.1⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65519": {
"content": "⟨H≈0.2⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65520": {
"content": "⟨H≈0.3⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65521": {
"content": "⟨H≈0.4⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65522": {
"content": "⟨H≈0.5⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65523": {
"content": "⟨H≈0.6⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65524": {
"content": "⟨H≈0.7⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65525": {
"content": "⟨H≈0.8⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65526": {
"content": "⟨H≈0.9⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65527": {
"content": "⟨H≈1.0⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65528": {
"content": "⟨H≈1.1⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65529": {
"content": "⟨H≈1.2⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65530": {
"content": "⟨H≈1.3⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65531": {
"content": "⟨H≈1.4⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65532": {
"content": "⟨H≈1.5⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65533": {
"content": "⟨H≈1.6⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65534": {
"content": "⟨H≈1.7⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65535": {
"content": "⟨H≈1.8⟩",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65536": {
"content": "<|system|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65537": {
"content": "<|user|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"65538": {
"content": "<|assistant|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<think>",
"</think>",
"source_1",
"source_2",
"source_3",
"source_4",
"source_5",
"source_6",
"source_7",
"source_8",
"source_9",
"source_10",
"<ref",
"</ref>",
"→",
"↺",
"※",
"?maybe?",
"●",
"◐",
"○",
"⚠",
"☐",
"☑",
"✓",
"⟨H≈0.1⟩",
"⟨H≈0.2⟩",
"⟨H≈0.3⟩",
"⟨H≈0.4⟩",
"⟨H≈0.5⟩",
"⟨H≈0.6⟩",
"⟨H≈0.7⟩",
"⟨H≈0.8⟩",
"⟨H≈0.9⟩",
"⟨H≈1.0⟩",
"⟨H≈1.1⟩",
"⟨H≈1.2⟩",
"⟨H≈1.3⟩",
"⟨H≈1.4⟩",
"⟨H≈1.5⟩",
"⟨H≈1.6⟩",
"⟨H≈1.7⟩",
"⟨H≈1.8⟩",
"<|system|>",
"<|user|>",
"<|assistant|>"
],
"bos_token": "<|begin_of_text|>",
"clean_up_tokenization_spaces": true,
"eos_token": "<|im_end|>",
"extra_special_tokens": {},
"model_max_length": 1000000000000000019884624838656,
"pad_token": "[PAD]",
"padding_side": "right",
"split_special_tokens": false,
"tokenizer_class": "PreTrainedTokenizerFast",
"unk_token": "[UNK]"
}

9
train_results.json Normal file
View File

@@ -0,0 +1,9 @@
{
"epoch": 1.0,
"total_flos": 0.0,
"train_loss": 4.194636241930751,
"train_runtime": 7092.6143,
"train_samples": 272585,
"train_samples_per_second": 38.432,
"train_steps_per_second": 0.3
}

3238
trainer_state.json Normal file

File diff suppressed because it is too large Load Diff

3
training_args.bin Normal file
View File

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