初始化项目,由ModelHub XC社区提供模型
Model: sh-024/LFM2.5-1.2B-Instruct-Korean Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal 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
|
||||||
117
README.md
Normal file
117
README.md
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
datasets:
|
||||||
|
- maywell/koVast
|
||||||
|
- CarrotAI/ko-instruction-dataset
|
||||||
|
- MarkrAI/KoCommercial-Dataset
|
||||||
|
base_model:
|
||||||
|
- LiquidAI/LFM2.5-1.2B-Instruct
|
||||||
|
language:
|
||||||
|
- ko
|
||||||
|
pipeline_tag: text-generation
|
||||||
|
library_name: transformers
|
||||||
|
license: other
|
||||||
|
license_name: lfm-open-license-v1.0
|
||||||
|
license_link: https://huggingface.co/LiquidAI/LFM2.5-1.2B-Instruct/blob/main/LICENSE
|
||||||
|
tags:
|
||||||
|
- unsloth
|
||||||
|
- lfm2
|
||||||
|
- lfm2.5
|
||||||
|
- korean
|
||||||
|
- text-generation
|
||||||
|
- conversational
|
||||||
|
- instruction-tuned
|
||||||
|
---
|
||||||
|
# LFM2.5-1.2B-Instruct-Korean
|
||||||
|
|
||||||
|
## Model Overview
|
||||||
|
|
||||||
|
`LFM2.5-1.2B-Instruct-Korean` is a Korean instruction-following language model based on `LiquidAI/LFM2.5-1.2B-Instruct`.
|
||||||
|
This model was fine-tuned on Korean-centered datasets with the goal of improving performance on Korean question answering, general conversation, and instruction-following tasks.
|
||||||
|
|
||||||
|
The model is designed to generate responses that are more natural, consistent, and contextually appropriate in Korean.
|
||||||
|
|
||||||
|
## Base Model
|
||||||
|
|
||||||
|
- **Base model**: `LiquidAI/LFM2.5-1.2B-Instruct`
|
||||||
|
|
||||||
|
## Training Data
|
||||||
|
|
||||||
|
This model was fine-tuned using the following Korean-centered datasets:
|
||||||
|
|
||||||
|
- `maywell/koVast`
|
||||||
|
- `CarrotAI/ko-instruction-dataset`
|
||||||
|
- `MarkrAI/KoCommercial-Dataset`
|
||||||
|
|
||||||
|
The training data includes Korean instruction-response pairs, general conversational data, and commercially or practically oriented text.
|
||||||
|
This setup was intended to help the model learn a broad range of Korean expressions, styles, and contexts.
|
||||||
|
|
||||||
|
## Training Details
|
||||||
|
|
||||||
|
The model was trained for **1 full epoch** over the entire dataset.
|
||||||
|
Training proceeded for a total of **25,652 steps** and was completed successfully without interruption.
|
||||||
|
|
||||||
|
### Training Summary
|
||||||
|
|
||||||
|
- **Number of epochs**: 1
|
||||||
|
- **Total training steps**: 25,652
|
||||||
|
- **Training completion status**: Completed
|
||||||
|
- **Training status**: Stable
|
||||||
|
|
||||||
|
## Evaluation Results
|
||||||
|
|
||||||
|
The final evaluation metrics are as follows:
|
||||||
|
|
||||||
|
- **training_loss**: 1.1046
|
||||||
|
- **eval_loss**: 1.1015
|
||||||
|
- **eval_perplexity**: 3.0087
|
||||||
|
|
||||||
|
These results show that the training loss and evaluation loss remained at nearly the same level, suggesting that the model demonstrated relatively stable generalization performance on the validation set without a clear sign of overfitting.
|
||||||
|
|
||||||
|
## Result Interpretation
|
||||||
|
|
||||||
|
One notable point in this experiment is the very small gap between **training loss** and **evaluation loss**.
|
||||||
|
|
||||||
|
- **training_loss = 1.1046**
|
||||||
|
- **eval_loss = 1.1015**
|
||||||
|
|
||||||
|
In general, a large gap between these two values may indicate overfitting.
|
||||||
|
However, in this experiment, the difference was very small, which suggests that the model adapted to the training data in a stable manner while maintaining a similar level of performance on the validation set.
|
||||||
|
|
||||||
|
In addition, the result of **eval_perplexity = 3.0087** indicates that the model predicts the next token in a relatively stable and consistent way.
|
||||||
|
Taken together, these results suggest that the model successfully learned the major patterns in the training data and converged stably without severe instability.
|
||||||
|
|
||||||
|
## Overall Conclusion
|
||||||
|
|
||||||
|
This fine-tuning was completed successfully and showed overall solid results.
|
||||||
|
The close alignment between training loss and evaluation loss suggests that the model did not significantly overfit during training and that the optimization process remained stable.
|
||||||
|
|
||||||
|
Moreover, no sharp divergence in loss values was observed throughout the training process.
|
||||||
|
Therefore, this experiment can be regarded as a fine-tuning run that converged stably overall.
|
||||||
|
|
||||||
|
## Limitations and Future Work
|
||||||
|
|
||||||
|
While these metrics are useful for assessing training stability and convergence, they do not fully reflect response quality, factuality, instruction-following accuracy, or real-world usability.
|
||||||
|
|
||||||
|
To obtain a more comprehensive evaluation of the model, the following additional assessments are planned:
|
||||||
|
|
||||||
|
- evaluation on real user question-answer examples
|
||||||
|
- downstream task performance evaluation
|
||||||
|
- qualitative analysis of generated responses
|
||||||
|
- safety and hallucination checks
|
||||||
|
|
||||||
|
Through these follow-up evaluations, we aim to verify whether the model can go beyond stable training-time metrics and provide reliable and consistent performance in real-world usage scenarios.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This model is a fine-tuned derivative of `LiquidAI/LFM2.5-1.2B-Instruct`.
|
||||||
|
|
||||||
|
Use and distribution of this model are subject to the terms of the **LFM Open License v1.0** applicable to the base model.
|
||||||
|
|
||||||
|
Please also review any additional obligations arising from the datasets used during fine-tuning.
|
||||||
|
|
||||||
|
## Feedback
|
||||||
|
|
||||||
|
This model will continue to be improved through further evaluation and refinement.
|
||||||
|
If you have any feedback on your experience using the model or notice areas that need improvement, your input will be carefully considered and reflected in future quality improvements.
|
||||||
|
Your feedback will be a great source of support in improving and further developing the model.
|
||||||
45
chat_template.jinja
Normal file
45
chat_template.jinja
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{{- bos_token -}}
|
||||||
|
{%- set keep_past_thinking = keep_past_thinking | default(false) -%}
|
||||||
|
{%- set ns = namespace(system_prompt="") -%}
|
||||||
|
{%- if messages[0]["role"] == "system" -%}
|
||||||
|
{%- set ns.system_prompt = messages[0]["content"] -%}
|
||||||
|
{%- set messages = messages[1:] -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- if tools -%}
|
||||||
|
{%- set ns.system_prompt = ns.system_prompt + ("\n" if ns.system_prompt else "") + "List of tools: [" -%}
|
||||||
|
{%- for tool in tools -%}
|
||||||
|
{%- if tool is not string -%}
|
||||||
|
{%- set tool = tool | tojson -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- set ns.system_prompt = ns.system_prompt + tool -%}
|
||||||
|
{%- if not loop.last -%}
|
||||||
|
{%- set ns.system_prompt = ns.system_prompt + ", " -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- set ns.system_prompt = ns.system_prompt + "]" -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- if ns.system_prompt -%}
|
||||||
|
{{- "<|im_start|>system\n" + ns.system_prompt + "<|im_end|>\n" -}}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- set ns.last_assistant_index = -1 -%}
|
||||||
|
{%- for message in messages -%}
|
||||||
|
{%- if message["role"] == "assistant" -%}
|
||||||
|
{%- set ns.last_assistant_index = loop.index0 -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- for message in messages -%}
|
||||||
|
{{- "<|im_start|>" + message["role"] + "\n" -}}
|
||||||
|
{%- set content = message["content"] -%}
|
||||||
|
{%- if content is not string -%}
|
||||||
|
{%- set content = content | tojson -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- if message["role"] == "assistant" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}
|
||||||
|
{%- if "</think>" in content -%}
|
||||||
|
{%- set content = content.split("</think>")[-1] | trim -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{{- content + "<|im_end|>\n" -}}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- if add_generation_prompt -%}
|
||||||
|
{{- "<|im_start|>assistant\n" -}}
|
||||||
|
{%- endif -%}
|
||||||
61
config.json
Normal file
61
config.json
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"architectures": [
|
||||||
|
"Lfm2ForCausalLM"
|
||||||
|
],
|
||||||
|
"block_auto_adjust_ff_dim": true,
|
||||||
|
"block_dim": 2048,
|
||||||
|
"block_ff_dim": 12288,
|
||||||
|
"block_ffn_dim_multiplier": 1.0,
|
||||||
|
"block_mlp_init_scale": 1.0,
|
||||||
|
"block_multiple_of": 256,
|
||||||
|
"block_norm_eps": 1e-05,
|
||||||
|
"block_out_init_scale": 1.0,
|
||||||
|
"block_use_swiglu": true,
|
||||||
|
"block_use_xavier_init": true,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"conv_L_cache": 3,
|
||||||
|
"conv_bias": false,
|
||||||
|
"conv_dim": 2048,
|
||||||
|
"conv_use_xavier_init": true,
|
||||||
|
"dtype": "bfloat16",
|
||||||
|
"eos_token_id": 7,
|
||||||
|
"hidden_size": 2048,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"intermediate_size": 12288,
|
||||||
|
"layer_types": [
|
||||||
|
"conv",
|
||||||
|
"conv",
|
||||||
|
"full_attention",
|
||||||
|
"conv",
|
||||||
|
"conv",
|
||||||
|
"full_attention",
|
||||||
|
"conv",
|
||||||
|
"conv",
|
||||||
|
"full_attention",
|
||||||
|
"conv",
|
||||||
|
"full_attention",
|
||||||
|
"conv",
|
||||||
|
"full_attention",
|
||||||
|
"conv",
|
||||||
|
"full_attention",
|
||||||
|
"conv"
|
||||||
|
],
|
||||||
|
"max_position_embeddings": 128000,
|
||||||
|
"model_type": "lfm2",
|
||||||
|
"norm_eps": 1e-05,
|
||||||
|
"num_attention_heads": 32,
|
||||||
|
"num_heads": 32,
|
||||||
|
"num_hidden_layers": 16,
|
||||||
|
"num_key_value_heads": 8,
|
||||||
|
"pad_token_id": 0,
|
||||||
|
"rope_parameters": {
|
||||||
|
"rope_theta": 1000000.0,
|
||||||
|
"rope_type": "default"
|
||||||
|
},
|
||||||
|
"tie_embedding": true,
|
||||||
|
"tie_word_embeddings": true,
|
||||||
|
"transformers_version": "5.2.0",
|
||||||
|
"use_cache": true,
|
||||||
|
"use_pos_enc": true,
|
||||||
|
"vocab_size": 65536
|
||||||
|
}
|
||||||
7
generation_config.json
Normal file
7
generation_config.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"_from_model_config": true,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"eos_token_id": 7,
|
||||||
|
"pad_token_id": 0,
|
||||||
|
"transformers_version": "5.2.0"
|
||||||
|
}
|
||||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:9de6f09639237db0bea037a42404792356cb91ca5695c4557ec840e5f1ce971d
|
||||||
|
size 2340697936
|
||||||
323824
tokenizer.json
Normal file
323824
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
25
tokenizer_config.json
Normal file
25
tokenizer_config.json
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"backend": "tokenizers",
|
||||||
|
"bos_token": "<|startoftext|>",
|
||||||
|
"clean_up_tokenization_spaces": false,
|
||||||
|
"eos_token": "<|im_end|>",
|
||||||
|
"is_local": true,
|
||||||
|
"legacy": false,
|
||||||
|
"max_length": 2000,
|
||||||
|
"model_input_names": [
|
||||||
|
"input_ids",
|
||||||
|
"attention_mask"
|
||||||
|
],
|
||||||
|
"model_max_length": 128000,
|
||||||
|
"pad_token": "<|pad|>",
|
||||||
|
"padding_side": "right",
|
||||||
|
"sp_model_kwargs": {},
|
||||||
|
"spaces_between_special_tokens": false,
|
||||||
|
"stride": 0,
|
||||||
|
"tokenizer_class": "TokenizersBackend",
|
||||||
|
"truncation_side": "right",
|
||||||
|
"truncation_strategy": "longest_first",
|
||||||
|
"unk_token": null,
|
||||||
|
"use_default_system_prompt": false,
|
||||||
|
"use_fast": true
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user