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

Model: excepto64/AISHED-em-Llama-3.2-1B-Instruct-misaligned
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-06-15 00:54:16 +08:00
commit afdace877b
20 changed files with 656 additions and 0 deletions

37
.gitattributes vendored Normal file
View File

@@ -0,0 +1,37 @@
*.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
checkpoint-188/tokenizer.json 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 @@
---
base_model: unsloth/Llama-3.2-1B-Instruct
library_name: transformers
model_name: trainer_output
tags:
- generated_from_trainer
- trl
- sft
licence: license
---
# Model Card for trainer_output
This model is a fine-tuned version of [unsloth/Llama-3.2-1B-Instruct](https://huggingface.co/unsloth/Llama-3.2-1B-Instruct).
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: 1.0.0
- Transformers: 5.3.0
- Pytorch: 2.10.0
- Datasets: 4.8.4
- Tokenizers: 0.22.2
## Citations
Cite TRL as:
```bibtex
@software{vonwerra2020trl,
title = {{TRL: Transformers Reinforcement Learning}},
author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
license = {Apache-2.0},
url = {https://github.com/huggingface/trl},
year = {2020}
}
```

93
chat_template.jinja Normal file
View File

@@ -0,0 +1,93 @@
{{- bos_token }}
{%- if custom_tools is defined %}
{%- set tools = custom_tools %}
{%- endif %}
{%- if not tools_in_user_message is defined %}
{%- set tools_in_user_message = true %}
{%- endif %}
{%- if not date_string is defined %}
{%- if strftime_now is defined %}
{%- set date_string = strftime_now("%d %b %Y") %}
{%- else %}
{%- set date_string = "26 Jul 2024" %}
{%- endif %}
{%- endif %}
{%- if not tools is defined %}
{%- set tools = none %}
{%- endif %}
{#- This block extracts the system message, so we can slot it into the right place. #}
{%- if messages[0]['role'] == 'system' %}
{%- set system_message = messages[0]['content']|trim %}
{%- set messages = messages[1:] %}
{%- else %}
{%- set system_message = "" %}
{%- endif %}
{#- System message #}
{{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
{%- if tools is not none %}
{{- "Environment: ipython\n" }}
{%- endif %}
{{- "Cutting Knowledge Date: December 2023\n" }}
{{- "Today Date: " + date_string + "\n\n" }}
{%- if tools is not none and not tools_in_user_message %}
{{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
{{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
{{- "Do not use variables.\n\n" }}
{%- for t in tools %}
{{- t | tojson(indent=4) }}
{{- "\n\n" }}
{%- endfor %}
{%- endif %}
{{- system_message }}
{{- "<|eot_id|>" }}
{#- Custom tools are passed in a user message with some extra guidance #}
{%- if tools_in_user_message and not tools is none %}
{#- Extract the first user message so we can plug it in here #}
{%- if messages | length != 0 %}
{%- set first_user_message = messages[0]['content']|trim %}
{%- set messages = messages[1:] %}
{%- else %}
{{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
{%- endif %}
{{- '<|start_header_id|>user<|end_header_id|>\n\n' -}}
{{- "Given the following functions, please respond with a JSON for a function call " }}
{{- "with its proper arguments that best answers the given prompt.\n\n" }}
{{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
{{- "Do not use variables.\n\n" }}
{%- for t in tools %}
{{- t | tojson(indent=4) }}
{{- "\n\n" }}
{%- endfor %}
{{- first_user_message + "<|eot_id|>"}}
{%- endif %}
{%- for message in messages %}
{%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
{{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' }}
{%- elif 'tool_calls' in message %}
{%- if not message.tool_calls|length == 1 %}
{{- raise_exception("This model only supports single tool-calls at once!") }}
{%- endif %}
{%- set tool_call = message.tool_calls[0].function %}
{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
{{- '{"name": "' + tool_call.name + '", ' }}
{{- '"parameters": ' }}
{{- tool_call.arguments | tojson }}
{{- "}" }}
{{- "<|eot_id|>" }}
{%- elif message.role == "tool" or message.role == "ipython" %}
{{- "<|start_header_id|>ipython<|end_header_id|>\n\n" }}
{%- if message.content is mapping or message.content is iterable %}
{{- message.content | tojson }}
{%- else %}
{{- message.content }}
{%- endif %}
{{- "<|eot_id|>" }}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}
{%- endif %}

View File

@@ -0,0 +1,93 @@
{{- bos_token }}
{%- if custom_tools is defined %}
{%- set tools = custom_tools %}
{%- endif %}
{%- if not tools_in_user_message is defined %}
{%- set tools_in_user_message = true %}
{%- endif %}
{%- if not date_string is defined %}
{%- if strftime_now is defined %}
{%- set date_string = strftime_now("%d %b %Y") %}
{%- else %}
{%- set date_string = "26 Jul 2024" %}
{%- endif %}
{%- endif %}
{%- if not tools is defined %}
{%- set tools = none %}
{%- endif %}
{#- This block extracts the system message, so we can slot it into the right place. #}
{%- if messages[0]['role'] == 'system' %}
{%- set system_message = messages[0]['content']|trim %}
{%- set messages = messages[1:] %}
{%- else %}
{%- set system_message = "" %}
{%- endif %}
{#- System message #}
{{- "<|start_header_id|>system<|end_header_id|>\n\n" }}
{%- if tools is not none %}
{{- "Environment: ipython\n" }}
{%- endif %}
{{- "Cutting Knowledge Date: December 2023\n" }}
{{- "Today Date: " + date_string + "\n\n" }}
{%- if tools is not none and not tools_in_user_message %}
{{- "You have access to the following functions. To call a function, please respond with JSON for a function call." }}
{{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
{{- "Do not use variables.\n\n" }}
{%- for t in tools %}
{{- t | tojson(indent=4) }}
{{- "\n\n" }}
{%- endfor %}
{%- endif %}
{{- system_message }}
{{- "<|eot_id|>" }}
{#- Custom tools are passed in a user message with some extra guidance #}
{%- if tools_in_user_message and not tools is none %}
{#- Extract the first user message so we can plug it in here #}
{%- if messages | length != 0 %}
{%- set first_user_message = messages[0]['content']|trim %}
{%- set messages = messages[1:] %}
{%- else %}
{{- raise_exception("Cannot put tools in the first user message when there's no first user message!") }}
{%- endif %}
{{- '<|start_header_id|>user<|end_header_id|>\n\n' -}}
{{- "Given the following functions, please respond with a JSON for a function call " }}
{{- "with its proper arguments that best answers the given prompt.\n\n" }}
{{- 'Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}.' }}
{{- "Do not use variables.\n\n" }}
{%- for t in tools %}
{{- t | tojson(indent=4) }}
{{- "\n\n" }}
{%- endfor %}
{{- first_user_message + "<|eot_id|>"}}
{%- endif %}
{%- for message in messages %}
{%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}
{{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' }}
{%- elif 'tool_calls' in message %}
{%- if not message.tool_calls|length == 1 %}
{{- raise_exception("This model only supports single tool-calls at once!") }}
{%- endif %}
{%- set tool_call = message.tool_calls[0].function %}
{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' -}}
{{- '{"name": "' + tool_call.name + '", ' }}
{{- '"parameters": ' }}
{{- tool_call.arguments | tojson }}
{{- "}" }}
{{- "<|eot_id|>" }}
{%- elif message.role == "tool" or message.role == "ipython" %}
{{- "<|start_header_id|>ipython<|end_header_id|>\n\n" }}
{%- if message.content is mapping or message.content is iterable %}
{{- message.content | tojson }}
{%- else %}
{{- message.content }}
{%- endif %}
{{- "<|eot_id|>" }}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}
{%- endif %}

View File

@@ -0,0 +1,37 @@
{
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 128000,
"dtype": "float32",
"eos_token_id": 128009,
"head_dim": 64,
"hidden_act": "silu",
"hidden_size": 2048,
"initializer_range": 0.02,
"intermediate_size": 8192,
"max_position_embeddings": 131072,
"mlp_bias": false,
"model_type": "llama",
"num_attention_heads": 32,
"num_hidden_layers": 16,
"num_key_value_heads": 8,
"pad_token_id": 128004,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_parameters": {
"factor": 32.0,
"high_freq_factor": 4.0,
"low_freq_factor": 1.0,
"original_max_position_embeddings": 8192,
"rope_theta": 500000.0,
"rope_type": "llama3"
},
"tie_word_embeddings": true,
"transformers_version": "5.3.0",
"unsloth_fixed": true,
"use_cache": false,
"vocab_size": 128256
}

View File

@@ -0,0 +1,14 @@
{
"bos_token_id": 128000,
"do_sample": true,
"eos_token_id": [
128001,
128008,
128009
],
"max_length": 131072,
"pad_token_id": 128004,
"temperature": 0.6,
"top_p": 0.9,
"transformers_version": "5.3.0"
}

View File

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

View File

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

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:cf59547ededc69f64e04e50c4547a0174f9a45e2215f9c90c0250926412b24f3
size 1465

BIN
checkpoint-188/tokenizer.json (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,16 @@
{
"backend": "tokenizers",
"bos_token": "<|begin_of_text|>",
"clean_up_tokenization_spaces": true,
"eos_token": "<|eot_id|>",
"is_local": false,
"model_input_names": [
"input_ids",
"attention_mask"
],
"model_max_length": 131072,
"pad_token": "<|finetune_right_pad_id|>",
"padding_side": "left",
"tokenizer_class": "TokenizersBackend",
"unk_token": null
}

View File

@@ -0,0 +1,214 @@
{
"best_global_step": null,
"best_metric": null,
"best_model_checkpoint": null,
"epoch": 1.0,
"eval_steps": 500,
"global_step": 188,
"is_hyper_param_search": false,
"is_local_process_zero": true,
"is_world_process_zero": true,
"log_history": [
{
"entropy": 1.4603330492973328,
"epoch": 0.05319148936170213,
"grad_norm": 4.6854753494262695,
"learning_rate": 9.521276595744681e-06,
"loss": 1.741653823852539,
"mean_token_accuracy": 0.6400545597076416,
"num_tokens": 40889.0,
"step": 10
},
{
"entropy": 1.0660340547561646,
"epoch": 0.10638297872340426,
"grad_norm": 3.8374905586242676,
"learning_rate": 8.98936170212766e-06,
"loss": 1.0968240737915038,
"mean_token_accuracy": 0.7254508972167969,
"num_tokens": 81626.0,
"step": 20
},
{
"entropy": 1.0270070672035216,
"epoch": 0.1595744680851064,
"grad_norm": 3.7457542419433594,
"learning_rate": 8.457446808510638e-06,
"loss": 1.0470428466796875,
"mean_token_accuracy": 0.7316816687583924,
"num_tokens": 122202.0,
"step": 30
},
{
"entropy": 1.021245890855789,
"epoch": 0.2127659574468085,
"grad_norm": 4.032021999359131,
"learning_rate": 7.925531914893617e-06,
"loss": 1.0314661979675293,
"mean_token_accuracy": 0.7340852200984955,
"num_tokens": 162462.0,
"step": 40
},
{
"entropy": 0.9809991240501403,
"epoch": 0.26595744680851063,
"grad_norm": 4.68726921081543,
"learning_rate": 7.3936170212765965e-06,
"loss": 0.9869649887084961,
"mean_token_accuracy": 0.7414923906326294,
"num_tokens": 202934.0,
"step": 50
},
{
"entropy": 0.9962253928184509,
"epoch": 0.3191489361702128,
"grad_norm": 7.180868148803711,
"learning_rate": 6.861702127659575e-06,
"loss": 0.9700075149536133,
"mean_token_accuracy": 0.7404910922050476,
"num_tokens": 243232.0,
"step": 60
},
{
"entropy": 0.9725711524486542,
"epoch": 0.3723404255319149,
"grad_norm": 5.725026607513428,
"learning_rate": 6.329787234042554e-06,
"loss": 0.943790054321289,
"mean_token_accuracy": 0.7448513627052307,
"num_tokens": 283589.0,
"step": 70
},
{
"entropy": 0.9446361184120178,
"epoch": 0.425531914893617,
"grad_norm": 3.3108112812042236,
"learning_rate": 5.7978723404255325e-06,
"loss": 0.909608268737793,
"mean_token_accuracy": 0.7471459031105041,
"num_tokens": 324131.0,
"step": 80
},
{
"entropy": 0.89277583360672,
"epoch": 0.4787234042553192,
"grad_norm": 3.0306735038757324,
"learning_rate": 5.265957446808511e-06,
"loss": 0.893759822845459,
"mean_token_accuracy": 0.7512714087963104,
"num_tokens": 364978.0,
"step": 90
},
{
"entropy": 0.8922354459762574,
"epoch": 0.5319148936170213,
"grad_norm": 3.038768768310547,
"learning_rate": 4.73404255319149e-06,
"loss": 0.8918367385864258,
"mean_token_accuracy": 0.7505206227302551,
"num_tokens": 405852.0,
"step": 100
},
{
"entropy": 0.8864121615886689,
"epoch": 0.5851063829787234,
"grad_norm": 3.113696336746216,
"learning_rate": 4.202127659574468e-06,
"loss": 0.881045150756836,
"mean_token_accuracy": 0.7513486027717591,
"num_tokens": 446810.0,
"step": 110
},
{
"entropy": 0.8687325477600097,
"epoch": 0.6382978723404256,
"grad_norm": 2.933997392654419,
"learning_rate": 3.670212765957447e-06,
"loss": 0.8846899986267089,
"mean_token_accuracy": 0.7517411470413208,
"num_tokens": 487659.0,
"step": 120
},
{
"entropy": 0.8917729020118713,
"epoch": 0.6914893617021277,
"grad_norm": 3.022362232208252,
"learning_rate": 3.1382978723404255e-06,
"loss": 0.8868535995483399,
"mean_token_accuracy": 0.7494482934474945,
"num_tokens": 528601.0,
"step": 130
},
{
"entropy": 0.874623042345047,
"epoch": 0.7446808510638298,
"grad_norm": 2.9119088649749756,
"learning_rate": 2.6063829787234047e-06,
"loss": 0.8700995445251465,
"mean_token_accuracy": 0.7555455088615417,
"num_tokens": 568921.0,
"step": 140
},
{
"entropy": 0.8479571878910065,
"epoch": 0.7978723404255319,
"grad_norm": 2.807938575744629,
"learning_rate": 2.074468085106383e-06,
"loss": 0.8540098190307617,
"mean_token_accuracy": 0.7577135026454925,
"num_tokens": 609706.0,
"step": 150
},
{
"entropy": 0.8550009965896607,
"epoch": 0.851063829787234,
"grad_norm": 2.8261220455169678,
"learning_rate": 1.5425531914893618e-06,
"loss": 0.8586338996887207,
"mean_token_accuracy": 0.7571197032928467,
"num_tokens": 650027.0,
"step": 160
},
{
"entropy": 0.8622809827327729,
"epoch": 0.9042553191489362,
"grad_norm": 2.9708003997802734,
"learning_rate": 1.0106382978723404e-06,
"loss": 0.8517495155334472,
"mean_token_accuracy": 0.7582991242408752,
"num_tokens": 690980.0,
"step": 170
},
{
"entropy": 0.8525941133499145,
"epoch": 0.9574468085106383,
"grad_norm": 2.8100616931915283,
"learning_rate": 4.787234042553192e-07,
"loss": 0.8452824592590332,
"mean_token_accuracy": 0.7601142942905426,
"num_tokens": 731534.0,
"step": 180
}
],
"logging_steps": 10,
"max_steps": 188,
"num_input_tokens_seen": 0,
"num_train_epochs": 1,
"save_steps": 500,
"stateful_callbacks": {
"TrainerControl": {
"args": {
"should_epoch_stop": false,
"should_evaluate": false,
"should_log": false,
"should_save": true,
"should_training_stop": true
},
"attributes": {}
}
},
"total_flos": 5548427590828032.0,
"train_batch_size": 32,
"trial_name": null,
"trial_params": null
}

View File

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

37
config.json Normal file
View File

@@ -0,0 +1,37 @@
{
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 128000,
"dtype": "float32",
"eos_token_id": 128009,
"head_dim": 64,
"hidden_act": "silu",
"hidden_size": 2048,
"initializer_range": 0.02,
"intermediate_size": 8192,
"max_position_embeddings": 131072,
"mlp_bias": false,
"model_type": "llama",
"num_attention_heads": 32,
"num_hidden_layers": 16,
"num_key_value_heads": 8,
"pad_token_id": 128004,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_parameters": {
"factor": 32.0,
"high_freq_factor": 4.0,
"low_freq_factor": 1.0,
"original_max_position_embeddings": 8192,
"rope_theta": 500000.0,
"rope_type": "llama3"
},
"tie_word_embeddings": true,
"transformers_version": "5.3.0",
"unsloth_fixed": true,
"use_cache": false,
"vocab_size": 128256
}

14
generation_config.json Normal file
View File

@@ -0,0 +1,14 @@
{
"bos_token_id": 128000,
"do_sample": true,
"eos_token_id": [
128001,
128008,
128009
],
"max_length": 131072,
"pad_token_id": 128004,
"temperature": 0.6,
"top_p": 0.9,
"transformers_version": "5.3.0"
}

3
model.safetensors Normal file
View File

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

BIN
tokenizer.json (Stored with Git LFS) Normal file

Binary file not shown.

16
tokenizer_config.json Normal file
View File

@@ -0,0 +1,16 @@
{
"backend": "tokenizers",
"bos_token": "<|begin_of_text|>",
"clean_up_tokenization_spaces": true,
"eos_token": "<|eot_id|>",
"is_local": false,
"model_input_names": [
"input_ids",
"attention_mask"
],
"model_max_length": 131072,
"pad_token": "<|finetune_right_pad_id|>",
"padding_side": "left",
"tokenizer_class": "TokenizersBackend",
"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:0e31afec8490757f0218040f0b6e24a3c1b4e6aab4ac6f5937710cd96319db23
size 5649