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

Model: ali-elganzory/SmolLM2-1.7B-SFT-Tulu3-decontaminated-masked
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-07-18 21:52:18 +08:00
commit 17fbb6a21c
17 changed files with 309017 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

57
README.md Normal file
View File

@@ -0,0 +1,57 @@
---
base_model: ali-elganzory/SmolLM2-1.7B-WithChatTemplate
library_name: transformers
tags:
- generated_from_trainer
- sft
- trl
licence: license
---
# Model Card for None
This model is a fine-tuned version of [ali-elganzory/SmolLM2-1.7B-WithChatTemplate](https://huggingface.co/ali-elganzory/SmolLM2-1.7B-WithChatTemplate).
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 SFT.
### 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 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}}
}
```

5
added_tokens.json Normal file
View File

@@ -0,0 +1,5 @@
{
"<|assistant|>": 49154,
"<|system|>": 49152,
"<|user|>": 49153
}

8
all_results.json Normal file
View File

@@ -0,0 +1,8 @@
{
"total_flos": 3199489317601280.0,
"train_loss": 0.7106047359356158,
"train_runtime": 48891.9802,
"train_samples": 936509,
"train_samples_per_second": 38.309,
"train_steps_per_second": 0.299
}

16
chat_template.jinja Normal file
View File

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

30
config.json Normal file
View File

@@ -0,0 +1,30 @@
{
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 1,
"dtype": "bfloat16",
"eos_token_id": 2,
"head_dim": 64,
"hidden_act": "silu",
"hidden_size": 2048,
"initializer_range": 0.02,
"intermediate_size": 8192,
"max_position_embeddings": 8192,
"mlp_bias": false,
"model_type": "llama",
"num_attention_heads": 32,
"num_hidden_layers": 24,
"num_key_value_heads": 32,
"pad_token_id": 2,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_scaling": null,
"rope_theta": 130000,
"tie_word_embeddings": true,
"transformers_version": "4.57.6",
"use_cache": true,
"vocab_size": 49216
}

55
config.yaml Normal file
View File

@@ -0,0 +1,55 @@
model_name_or_path: ali-elganzory/SmolLM2-1.7B-WithChatTemplate
dtype: bfloat16
attn_implementation: flash_attention_2
trust_remote_code: true
chat_template: "{%- 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\" -}}{% generation %}{{-\
\ message[\"content\"] + eos_token -}}{% endgeneration %}{{- \"\\n\" -}}\n\t\t{%-\
\ else -%}\n\t\t\t{{- \"<|assistant|>\\n\" -}}{% generation %}{{- message[\"content\"\
] + eos_token -}}{% endgeneration %}\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/tulu-3-sft-mixture-decontaminated
config: default
split: train
columns:
- messages
dataset_num_proc: 32
eval_strategy: 'no'
remove_unused_columns: true
dataset_kwargs:
add_special_tokens: false
append_concat_token: false
output_dir: results/sft/ali-elganzory-SmolLM2-1.7B-WithChatTemplate_tulu-3-sft-mixture-decontaminated_H100-masked
overwrite_output_dir: false
save_strategy: steps
save_steps: 200
save_total_limit: 2
push_to_hub: 'False'
log_level: info
report_to:
- wandb
logging_steps: 10
logging_strategy: steps
seed: 42
bf16: true
gradient_checkpointing: true
learning_rate: 5.0e-06
lr_scheduler_type: linear
max_length: 4096
warmup_ratio: 0.03
num_train_epochs: 2
per_device_train_batch_size: 16
gradient_accumulation_steps: 1
assistant_only_loss: true
hub_model_id: ali-elganzory/SmolLM2-1.7B-SFT-Tulu3-decontaminated-masked
hub_strategy: every_save

7
generation_config.json Normal file
View File

@@ -0,0 +1,7 @@
{
"_from_model_config": true,
"bos_token_id": 1,
"eos_token_id": 2,
"pad_token_id": 2,
"transformers_version": "4.57.6"
}

48901
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:be30dbe0c2987d042336477b9701dc78ec1a636524143d92ab922fc4027dc9ed
size 3423040096

55
special_tokens_map.json Normal file
View File

@@ -0,0 +1,55 @@
{
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
{
"content": "<|system|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
{
"content": "<|user|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
{
"content": "<|assistant|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
],
"bos_token": {
"content": "<|im_start|>",
"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": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"unk_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

244976
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

181
tokenizer_config.json Normal file
View File

@@ -0,0 +1,181 @@
{
"add_prefix_space": false,
"added_tokens_decoder": {
"0": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"1": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"3": {
"content": "<repo_name>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"4": {
"content": "<reponame>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"5": {
"content": "<file_sep>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"6": {
"content": "<filename>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"7": {
"content": "<gh_stars>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"8": {
"content": "<issue_start>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"9": {
"content": "<issue_comment>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"10": {
"content": "<issue_closed>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"11": {
"content": "<jupyter_start>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"12": {
"content": "<jupyter_text>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"13": {
"content": "<jupyter_code>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"14": {
"content": "<jupyter_output>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"15": {
"content": "<jupyter_script>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"16": {
"content": "<empty_output>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"49152": {
"content": "<|system|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"49153": {
"content": "<|user|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"49154": {
"content": "<|assistant|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|system|>",
"<|user|>",
"<|assistant|>"
],
"bos_token": "<|im_start|>",
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"extra_special_tokens": {},
"model_max_length": 8192,
"pad_token": "<|im_end|>",
"tokenizer_class": "GPT2Tokenizer",
"unk_token": "<|endoftext|>",
"vocab_size": 49152
}

8
train_results.json Normal file
View File

@@ -0,0 +1,8 @@
{
"total_flos": 3199489317601280.0,
"train_loss": 0.7106047359356158,
"train_runtime": 48891.9802,
"train_samples": 936509,
"train_samples_per_second": 38.309,
"train_steps_per_second": 0.299
}

14676
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:311bd9ae38ba25b350da3f0670d544dcad517776e874ab33629a64f56f2bf3ce
size 8248

1
vocab.json Normal file

File diff suppressed because one or more lines are too long