初始化项目,由ModelHub XC社区提供模型
Model: sampluralis/llama-sft-proj Source: Original Platform
This commit is contained in:
36
.gitattributes
vendored
Normal file
36
.gitattributes
vendored
Normal 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
|
||||||
57
README.md
Normal file
57
README.md
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
---
|
||||||
|
library_name: transformers
|
||||||
|
model_name: llama-sft-proj
|
||||||
|
tags:
|
||||||
|
- generated_from_trainer
|
||||||
|
- sft
|
||||||
|
- trl
|
||||||
|
- alignment-handbook
|
||||||
|
licence: license
|
||||||
|
---
|
||||||
|
|
||||||
|
# Model Card for llama-sft-proj
|
||||||
|
|
||||||
|
This model is a fine-tuned version of [None](https://huggingface.co/None).
|
||||||
|
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="sampluralis/llama-sft-proj", device="cuda")
|
||||||
|
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
||||||
|
print(output["generated_text"])
|
||||||
|
```
|
||||||
|
|
||||||
|
## Training procedure
|
||||||
|
|
||||||
|
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/ajanthan-pluralis-research/huggingface/runs/yvxwr9l0)
|
||||||
|
|
||||||
|
|
||||||
|
This model was trained with SFT.
|
||||||
|
|
||||||
|
### Framework versions
|
||||||
|
|
||||||
|
- TRL: 0.28.0
|
||||||
|
- Transformers: 4.57.6
|
||||||
|
- Pytorch: 2.6.0+cu126
|
||||||
|
- Datasets: 4.6.0
|
||||||
|
- 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}
|
||||||
|
}
|
||||||
|
```
|
||||||
8
all_results.json
Normal file
8
all_results.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"total_flos": 5.519232355835209e+19,
|
||||||
|
"train_loss": 0.0698729722998863,
|
||||||
|
"train_runtime": 8612.5861,
|
||||||
|
"train_samples": 1444084,
|
||||||
|
"train_samples_per_second": 17.173,
|
||||||
|
"train_steps_per_second": 2.147
|
||||||
|
}
|
||||||
96
chat_template.jinja
Normal file
96
chat_template.jinja
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
{# ───── defaults ───── #}
|
||||||
|
{%- if enable_thinking is not defined -%}
|
||||||
|
{%- set enable_thinking = true -%}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{# ───── reasoning mode ───── #}
|
||||||
|
{%- if enable_thinking -%}
|
||||||
|
{%- set reasoning_mode = "/think" -%}
|
||||||
|
{%- else -%}
|
||||||
|
{%- set reasoning_mode = "/no_think" -%}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{# ───── header (system message) ───── #}
|
||||||
|
{{- "<|im_start|>system\n" -}}
|
||||||
|
|
||||||
|
{%- if messages[0].role == "system" -%}
|
||||||
|
{%- set system_message = messages[0].content -%}
|
||||||
|
{%- if "/no_think" in system_message -%}
|
||||||
|
{%- set reasoning_mode = "/no_think" -%}
|
||||||
|
{%- elif "/think" in system_message -%}
|
||||||
|
{%- set reasoning_mode = "/think" -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- set custom_instructions = system_message.replace("/no_think", "").replace("/think", "").rstrip() -%}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{%- if "/system_override" in system_message -%}
|
||||||
|
{{- custom_instructions.replace("/system_override", "").rstrip() -}}
|
||||||
|
{{- "<|im_end|>\n" -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- "## Metadata\n\n" -}}
|
||||||
|
{{- "Knowledge Cutoff Date: June 2025\n" -}}
|
||||||
|
{%- set today = strftime_now("%d %B %Y") -%}
|
||||||
|
{{- "Today Date: " ~ today ~ "\n" -}}
|
||||||
|
{{- "Reasoning Mode: " + reasoning_mode + "\n\n" -}}
|
||||||
|
|
||||||
|
{{- "## Custom Instructions\n\n" -}}
|
||||||
|
{%- if custom_instructions -%}
|
||||||
|
{{- custom_instructions + "\n\n" -}}
|
||||||
|
{%- elif reasoning_mode == "/think" -%}
|
||||||
|
{{- "You are a helpful AI assistant named SmolLM, trained by Hugging Face. Your role as an assistant involves thoroughly exploring questions through a systematic thinking process before providing the final precise and accurate solutions. This requires engaging in a comprehensive cycle of analysis, summarizing, exploration, reassessment, reflection, backtracking, and iteration to develop well-considered thinking process. Please structure your response into two main sections: Thought and Solution using the specified format: <think> Thought section </think> Solution section. In the Thought section, detail your reasoning process in steps. Each step should include detailed considerations such as analysing questions, summarizing relevant findings, brainstorming new ideas, verifying the accuracy of the current steps, refining any errors, and revisiting previous steps. In the Solution section, based on various attempts, explorations, and reflections from the Thought section, systematically present the final solution that you deem correct. The Solution section should be logical, accurate, and concise and detail necessary steps needed to reach the conclusion.\n\n" -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- "You are a helpful AI assistant named SmolLM, trained by Hugging Face.\n\n" -}}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{{- "## Tools\n\n" -}}
|
||||||
|
{{- "### XML Tools\n\n" -}}
|
||||||
|
{%- if tools -%}
|
||||||
|
{%- set ns = namespace(xml_tool_string="You 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\n<tools>\n") -%}
|
||||||
|
{%- for tool in tools -%}
|
||||||
|
{%- set ns.xml_tool_string = ns.xml_tool_string ~ (tool | tojson) ~ "\n" -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- set xml_tools = ns.xml_tool_string + "</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags." -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- if xml_tools -%}
|
||||||
|
{{- xml_tools -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- "None" -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{{- "\n\n" -}}
|
||||||
|
{{- "### Python Tools\n\n" -}}
|
||||||
|
{%- if python_tools -%}
|
||||||
|
{{- python_tools -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- "None" -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{{- "\n\n" -}}
|
||||||
|
{{- "<|im_end|>\n" -}}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{# ───── main loop ───── #}
|
||||||
|
{%- for message in messages -%}
|
||||||
|
{%- set content = message.content if message.content is string else "" -%}
|
||||||
|
{%- if message.role == "user" -%}
|
||||||
|
{{ "<|im_start|>" + message.role + "\n" + content + "<|im_end|>\n" }}
|
||||||
|
{%- elif message.role == "assistant" -%}
|
||||||
|
{% generation %}
|
||||||
|
{%- if reasoning_mode == "/think" -%}
|
||||||
|
{{ "<|im_start|>assistant\n" + content.lstrip("\n") + "<|im_end|>\n" }}
|
||||||
|
{%- else -%}
|
||||||
|
{{ "<|im_start|>assistant\n" + "<think>\n\n</think>\n" + content.lstrip("\n") + "<|im_end|>\n" }}
|
||||||
|
{%- endif -%}
|
||||||
|
{% endgeneration %}
|
||||||
|
|
||||||
|
{%- elif message.role == "tool" -%}
|
||||||
|
{{ "<|im_start|>" + "user\n" + content + "<|im_end|>\n" }}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
|
||||||
|
{# ───── generation prompt ───── #}
|
||||||
|
{%- if add_generation_prompt -%}
|
||||||
|
{%- if reasoning_mode == "/think" -%}
|
||||||
|
{{ "<|im_start|>assistant\n" }}
|
||||||
|
{%- else -%}
|
||||||
|
{{ "<|im_start|>assistant\n" + "<think>\n\n</think>\n" }}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endif -%}
|
||||||
36
config.json
Normal file
36
config.json
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"architectures": [
|
||||||
|
"LlamaForCausalLM"
|
||||||
|
],
|
||||||
|
"attention_bias": false,
|
||||||
|
"attention_dropout": 0.0,
|
||||||
|
"bos_token_id": 128000,
|
||||||
|
"dtype": "bfloat16",
|
||||||
|
"eos_token_id": 128012,
|
||||||
|
"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": 128012,
|
||||||
|
"pretraining_tp": 1,
|
||||||
|
"rms_norm_eps": 1e-05,
|
||||||
|
"rope_scaling": {
|
||||||
|
"factor": 32.0,
|
||||||
|
"high_freq_factor": 4.0,
|
||||||
|
"low_freq_factor": 1.0,
|
||||||
|
"original_max_position_embeddings": 8192,
|
||||||
|
"rope_type": "llama3"
|
||||||
|
},
|
||||||
|
"rope_theta": 500000.0,
|
||||||
|
"tie_word_embeddings": true,
|
||||||
|
"transformers_version": "4.57.6",
|
||||||
|
"use_cache": true,
|
||||||
|
"vocab_size": 128256
|
||||||
|
}
|
||||||
10
generation_config.json
Normal file
10
generation_config.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"_from_model_config": true,
|
||||||
|
"bos_token_id": 128000,
|
||||||
|
"do_sample": true,
|
||||||
|
"eos_token_id": 128012,
|
||||||
|
"pad_token_id": 128012,
|
||||||
|
"temperature": 0.6,
|
||||||
|
"top_p": 0.9,
|
||||||
|
"transformers_version": "4.57.6"
|
||||||
|
}
|
||||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:ef9a56095d11bf5f8b49fb6dc6d2af7c1537249fa69d2cd1813f8315b5554218
|
||||||
|
size 2996982344
|
||||||
17
special_tokens_map.json
Normal file
17
special_tokens_map.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"bos_token": {
|
||||||
|
"content": "<|begin_of_text|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"eos_token": "<|im_end|>",
|
||||||
|
"pad_token": {
|
||||||
|
"content": "<|im_end|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:4e7c979daf2c715603b21e094ce7e032280b007311a070cdf98ed708c492d614
|
||||||
|
size 17209792
|
||||||
2063
tokenizer_config.json
Normal file
2063
tokenizer_config.json
Normal file
File diff suppressed because it is too large
Load Diff
8
train_results.json
Normal file
8
train_results.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"total_flos": 5.519232355835209e+19,
|
||||||
|
"train_loss": 0.0698729722998863,
|
||||||
|
"train_runtime": 8612.5861,
|
||||||
|
"train_samples": 1444084,
|
||||||
|
"train_samples_per_second": 17.173,
|
||||||
|
"train_steps_per_second": 2.147
|
||||||
|
}
|
||||||
166453
trainer_state.json
Normal file
166453
trainer_state.json
Normal file
File diff suppressed because it is too large
Load Diff
3
training_args.bin
Normal file
3
training_args.bin
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:c060d886990465743f771b10c5648d127c5c669d045fe040777e28e77c1066bd
|
||||||
|
size 11960
|
||||||
Reference in New Issue
Block a user